Class GraphQlHttpHandler.Builder

java.lang.Object
org.springframework.graphql.server.webmvc.GraphQlHttpHandler.Builder
Enclosing class:
GraphQlHttpHandler

public static final class GraphQlHttpHandler.Builder extends Object
Builder for GraphQlHttpHandler.
Since:
2.1.0
Author:
Rossen Stoyanchev, Brian Clozel
  • Method Details

    • messageConverter

      public GraphQlHttpHandler.Builder messageConverter(HttpMessageConverter<?> converter)
      Set the converter to use to read and write GraphQL payloads.

      If not set, the handler will use the one configured for web use.

      Parameters:
      converter - the converter to use
    • httpMethods

      public GraphQlHttpHandler.Builder httpMethods(HttpMethod... httpMethods)
      Set the HTTP methods that the handler should support.

      By default, only HttpMethod.POST is supported. Enabling HttpMethod.GET means that queries and their parameters are exposed through the request URL; consider the security implications, for example URLs being logged or cached, before enabling it.

      Parameters:
      httpMethods - the HTTP methods to support
    • build

      public GraphQlHttpHandler build()