Class AbstractGraphQlHttpHandler

java.lang.Object
org.springframework.graphql.server.webflux.AbstractGraphQlHttpHandler
Direct Known Subclasses:
GraphQlHttpHandler, GraphQlSseHandler

public abstract class AbstractGraphQlHttpHandler extends Object
Abstract base class for GraphQL over HTTP handlers.
Since:
1.3.0
Author:
Brian Clozel, Rossen Stoyanchev
  • Field Details

    • logger

      protected final Log logger
  • Constructor Details

  • Method Details

    • handleRequest

      public reactor.core.publisher.Mono<ServerResponse> handleRequest(ServerRequest request)
      Handle GraphQL over HTTP request.
      Parameters:
      request - the current request
      Returns:
      the resulting response
    • prepareResponse

      protected abstract reactor.core.publisher.Mono<ServerResponse> prepareResponse(ServerRequest request, WebGraphQlResponse response)
      Prepare the ServerResponse for the given GraphQL response.
      Parameters:
      request - the current request
      response - the GraphQL response
      Returns:
      the server response
    • encodeResponseIfNecessary

      protected Object encodeResponseIfNecessary(WebGraphQlResponse response)
      Encode the GraphQL response if custom codecs were provided, or return the result map.
      Parameters:
      response - the GraphQL response
      Returns:
      the encoded response or the result map
    • encode

      protected DataBuffer encode(Map<String,Object> resultMap)
      Encode the result map.

      This method assumes that a CodecConfigurer has been provided.

      Parameters:
      resultMap - the result to encode
      Returns:
      the encoded result map