Class GraphQLController

java.lang.Object
io.micronaut.configuration.graphql.GraphQLController

@Controller("${graphql.path:/graphql}") public class GraphQLController extends Object
The GraphQL controller handling GraphQL requests.
Since:
1.0
Author:
Marcel Overdijk, James Kleeh, Alexey Zhokhov
  • Constructor Details

  • Method Details

    • get

      @Get(produces="application/json", single=true) public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<String>> get(@QueryValue("query") String query, @Nullable @QueryValue("operationName") @Nullable String operationName, @Nullable @QueryValue("variables") @Nullable String variables, io.micronaut.http.HttpRequest httpRequest)
      Handles GraphQL GET requests.
      Parameters:
      query - the GraphQL query
      operationName - the GraphQL operation name
      variables - the GraphQL variables
      httpRequest - the HTTP request
      Returns:
      the GraphQL response
    • post

      @Post(consumes="*/*", produces="application/json", single=true) public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<String>> post(@Nullable @QueryValue("query") @Nullable String query, @Nullable @QueryValue("operationName") @Nullable String operationName, @Nullable @QueryValue("variables") @Nullable String variables, @Nullable @Body @Nullable String body, io.micronaut.http.HttpRequest httpRequest)
      Handles GraphQL POST requests.
      Parameters:
      query - the GraphQL query
      operationName - the GraphQL operation name
      variables - the GraphQL variables
      body - the GraphQL request body
      httpRequest - the HTTP request
      Returns:
      the GraphQL response