Class GraphQlHttpHandler

java.lang.Object
org.springframework.graphql.server.webmvc.GraphQlHttpHandler

public class GraphQlHttpHandler extends Object
GraphQL handler to expose as a WebMvc.fn endpoint via RouterFunctions.
Since:
1.0.0
Author:
Rossen Stoyanchev, Brian Clozel
  • Constructor Details

    • GraphQlHttpHandler

      public GraphQlHttpHandler(WebGraphQlHandler graphQlHandler)
      Create a new instance.
      Parameters:
      graphQlHandler - common handler for GraphQL over HTTP requests
  • Method Details

    • handleRequest

      public ServerResponse handleRequest(ServerRequest serverRequest) throws jakarta.servlet.ServletException
      Handle GraphQL requests over HTTP.
      Parameters:
      serverRequest - the incoming HTTP request
      Returns:
      the HTTP response
      Throws:
      jakarta.servlet.ServletException - may be raised when reading the request body, e.g. HttpMediaTypeNotSupportedException.