Class GraphQlMessageHandler

All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ExpressionCapable, Orderable, MessageProducer, HeaderPropagationAware, IntegrationPattern, NamedComponent, IntegrationManagement, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>

public class GraphQlMessageHandler extends AbstractReplyProducingMessageHandler
An AbstractReplyProducingMessageHandler capable of fielding GraphQL Query, Mutation and Subscription requests.
Daniel Frey, Artem Bilan
  • Constructor Details

    • GraphQlMessageHandler

      public GraphQlMessageHandler(org.springframework.graphql.ExecutionGraphQlService graphQlService)
  • Method Details

    • setOperation

      public void setOperation(String operation)
      Specify a GraphQL Operation.
      operation - the GraphQL operation to use.
    • setOperationExpression

      public void setOperationExpression(Expression operationExpression)
      Specify a SpEL expression to evaluate a GraphQL Operation
      operationExpression - the expression to evaluate a GraphQL Operation.
    • setOperationName

      public void setOperationName(String operationName)
      Set a GraphQL Operation Name to execute.
      operationName - the GraphQL Operation Name to use.
    • setOperationNameExpression

      public void setOperationNameExpression(Expression operationNameExpression)
      Set a SpEL expression to evaluate a GraphQL Operation Name to execute.
      operationNameExpression - the expression to use.
    • setVariablesExpression

      public void setVariablesExpression(Expression variablesExpression)
      Set a SpEL expression to evaluate Variables for GraphQL Operation to execute.
      variablesExpression - the expression to use.
    • setLocale

      public void setLocale(@Nullable Locale locale)
      Set a Locale for GraphQL Operation to execute.
      locale - the locale to use.
    • setExecutionIdExpression

      public void setExecutionIdExpression(Expression executionIdExpression)
      Set a SpEL expression to evaluate Execution Id for GraphQL Operation Request to execute.
      executionIdExpression - the executionIdExpression to use.
    • doInit

      protected final void doInit()
      doInit in class AbstractReplyProducingMessageHandler
    • handleRequestMessage

      protected Object handleRequestMessage(Message<?> requestMessage)
      Description copied from class: AbstractReplyProducingMessageHandler
      Subclasses must implement this method to handle the request Message. The return value may be a Message, a MessageBuilder, or any plain Object. The base class will handle the final creation of a reply Message from any of those starting points. If the return value is null, the Message flow will end here.
      Specified by:
      handleRequestMessage in class AbstractReplyProducingMessageHandler
      requestMessage - The request message.
      The result of handling the message, or null.