Class DefaultGraphQLInvocation

java.lang.Object
io.micronaut.configuration.graphql.DefaultGraphQLInvocation
All Implemented Interfaces:
GraphQLInvocation

@Singleton public class DefaultGraphQLInvocation extends Object implements GraphQLInvocation
The default implementation for invoking GraphQL requests.
Since:
1.0
Author:
Marcel Overdijk, Graeme Rocher, James Kleeh
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultGraphQLInvocation(graphql.GraphQL graphQL, GraphQLExecutionInputCustomizer graphQLExecutionInputCustomizer, @Nullable io.micronaut.context.BeanProvider<org.dataloader.DataLoaderRegistry> dataLoaderRegistry)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.reactivestreams.Publisher<graphql.ExecutionResult>
    invoke(GraphQLInvocationData invocationData, io.micronaut.http.HttpRequest httpRequest, @Nullable io.micronaut.http.MutableHttpResponse<String> httpResponse)
    Invokes the GraphQL request and returns a publisher that emits ExecutionResult objects.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultGraphQLInvocation

      public DefaultGraphQLInvocation(graphql.GraphQL graphQL, GraphQLExecutionInputCustomizer graphQLExecutionInputCustomizer, @Nullable @Nullable io.micronaut.context.BeanProvider<org.dataloader.DataLoaderRegistry> dataLoaderRegistry)
      Default constructor.
      Parameters:
      graphQL - the GraphQL instance
      graphQLExecutionInputCustomizer - the GraphQLExecutionInputCustomizer instance
      dataLoaderRegistry - the DataLoaderRegistry instance
  • Method Details

    • invoke

      public org.reactivestreams.Publisher<graphql.ExecutionResult> invoke(GraphQLInvocationData invocationData, io.micronaut.http.HttpRequest httpRequest, @Nullable @Nullable io.micronaut.http.MutableHttpResponse<String> httpResponse)
      Invokes the GraphQL request and returns a publisher that emits ExecutionResult objects.
      Specified by:
      invoke in interface GraphQLInvocation
      Parameters:
      invocationData - the GraphQL invocation data
      httpRequest - the HTTP request
      httpResponse - the mutable HTTP response, can be null when using websocket
      Returns:
      the GraphQL execution result