Class AbstractGraphQlHttpHandler
java.lang.Object
org.springframework.graphql.server.webflux.AbstractGraphQlHttpHandler
- Direct Known Subclasses:
GraphQlHttpHandler
,GraphQlSseHandler
Abstract base class for GraphQL over HTTP handlers.
- Since:
- 1.3.0
- Author:
- Brian Clozel, Rossen Stoyanchev
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractGraphQlHttpHandler
(WebGraphQlHandler graphQlHandler, CodecConfigurer codecConfigurer) -
Method Summary
Modifier and TypeMethodDescriptionprotected DataBuffer
Encode the result map.protected Object
encodeResponseIfNecessary
(WebGraphQlResponse response) Encode the GraphQL response if custom codecs were provided, or return the result map.reactor.core.publisher.Mono<ServerResponse>
handleRequest
(ServerRequest request) Handle GraphQL over HTTP request.protected abstract reactor.core.publisher.Mono<ServerResponse>
prepareResponse
(ServerRequest request, WebGraphQlResponse response) Prepare theServerResponse
for the given GraphQL response.
-
Field Details
-
logger
-
-
Constructor Details
-
AbstractGraphQlHttpHandler
protected AbstractGraphQlHttpHandler(WebGraphQlHandler graphQlHandler, @Nullable CodecConfigurer codecConfigurer)
-
-
Method Details
-
handleRequest
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 theServerResponse
for the given GraphQL response.- Parameters:
request
- the current requestresponse
- the GraphQL response- Returns:
- the server response
-
encodeResponseIfNecessary
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
Encode the result map.This method assumes that a
CodecConfigurer
has been provided.- Parameters:
resultMap
- the result to encode- Returns:
- the encoded result map
-