Class GraphQLController


  • @Controller("${graphql.path:/graphql}")
    public class GraphQLController
    extends java.lang.Object
    The GraphQL controller handling GraphQL requests.
    Since:
    1.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<java.lang.String>> get​(java.lang.String query, java.lang.String operationName, java.lang.String variables, io.micronaut.http.HttpRequest httpRequest)
      Handles GraphQL GET requests.
      org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<java.lang.String>> post​(java.lang.String query, java.lang.String operationName, java.lang.String variables, java.lang.String body, io.micronaut.http.HttpRequest httpRequest)
      Handles GraphQL POST requests.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

        @Get(produces="application/json",
             single=true)
        public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<java.lang.String>> get​(@QueryValue("query")
                                                                                                          java.lang.String query,
                                                                                                          @Nullable @QueryValue("operationName")
                                                                                                          java.lang.String operationName,
                                                                                                          @Nullable @QueryValue("variables")
                                                                                                          java.lang.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<java.lang.String>> post​(@Nullable @QueryValue("query")
                                                                                                           java.lang.String query,
                                                                                                           @Nullable @QueryValue("operationName")
                                                                                                           java.lang.String operationName,
                                                                                                           @Nullable @QueryValue("variables")
                                                                                                           java.lang.String variables,
                                                                                                           @Nullable @Body
                                                                                                           java.lang.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