Class AbstractGraphQlHttpHandler
java.lang.Object
org.springframework.graphql.server.webmvc.AbstractGraphQlHttpHandler
- Direct Known Subclasses:
- GraphQlHttpHandler,- GraphQlSseHandler
Abstract base class for GraphQL over HTTP handlers.
- Since:
- 1.3.0
- Author:
- Brian Clozel, Rossen Stoyanchev
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractGraphQlHttpHandler(WebGraphQlHandler graphQlHandler, HttpMessageConverter<?> messageConverter) 
- 
Method SummaryModifier and TypeMethodDescriptiongetWriteFunction(Map<String, Object> resultMap, MediaType contentType) Exposes aServerResponse.HeadersBuilder.WriteFunctionthat writes with theHttpMessageConverterprovided to the constructor.handleRequest(ServerRequest request) Handle GraphQL over HTTP requests.protected abstract ServerResponseprepareResponse(ServerRequest request, reactor.core.publisher.Mono<WebGraphQlResponse> responseMono) Prepare theServerResponsefor the given GraphQL response.
- 
Field Details- 
logger
 
- 
- 
Constructor Details- 
AbstractGraphQlHttpHandlerprotected AbstractGraphQlHttpHandler(WebGraphQlHandler graphQlHandler, @Nullable HttpMessageConverter<?> messageConverter) 
 
- 
- 
Method Details- 
getWriteFunction@Nullable protected ServerResponse.HeadersBuilder.WriteFunction getWriteFunction(Map<String, Object> resultMap, MediaType contentType) Exposes aServerResponse.HeadersBuilder.WriteFunctionthat writes with theHttpMessageConverterprovided to the constructor.- Parameters:
- resultMap- the result map to write
- contentType- to set the response content type to
- Returns:
- the write function, or nullif aHttpMessageConverterwas not provided to the constructor
 
- 
handleRequestHandle GraphQL over HTTP requests.- Parameters:
- request- the current request
- Returns:
- the resulting response
- Throws:
- jakarta.servlet.ServletException- may be raised when reading the request body, e.g.- HttpMediaTypeNotSupportedException.
 
- 
prepareResponseprotected abstract ServerResponse prepareResponse(ServerRequest request, reactor.core.publisher.Mono<WebGraphQlResponse> responseMono) throws jakarta.servlet.ServletException Prepare theServerResponsefor the given GraphQL response.- Parameters:
- request- the current request
- responseMono- the GraphQL response
- Returns:
- the server response
- Throws:
- jakarta.servlet.ServletException
 
 
-