Class GraphQlHttpHandler
java.lang.Object
org.springframework.graphql.server.webmvc.AbstractGraphQlHttpHandler
org.springframework.graphql.server.webmvc.GraphQlHttpHandler
GraphQL handler to expose as a WebMvc functional endpoint via
RouterFunctions.- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev, Brian Clozel
-
Field Summary
Fields inherited from class org.springframework.graphql.server.webmvc.AbstractGraphQlHttpHandler
logger -
Constructor Summary
ConstructorsConstructorDescriptionGraphQlHttpHandler(WebGraphQlHandler graphQlHandler) Create a new instance.GraphQlHttpHandler(WebGraphQlHandler graphQlHandler, HttpMessageConverter<?> converter) Create a new instance with a custom message converter for GraphQL payloads. -
Method Summary
Modifier and TypeMethodDescriptionprotected ServerResponseprepareResponse(ServerRequest request, reactor.core.publisher.Mono<WebGraphQlResponse> responseMono) Prepare theServerResponsefor the given GraphQL response.Methods inherited from class org.springframework.graphql.server.webmvc.AbstractGraphQlHttpHandler
getWriteFunction, handleRequest
-
Constructor Details
-
GraphQlHttpHandler
Create a new instance.- Parameters:
graphQlHandler- common handler for GraphQL over HTTP requests
-
GraphQlHttpHandler
public GraphQlHttpHandler(WebGraphQlHandler graphQlHandler, @Nullable HttpMessageConverter<?> converter) Create a new instance with a custom message converter for GraphQL payloads.If no converter is provided, the handler will use
the one configured for web use.- Parameters:
graphQlHandler- common handler for GraphQL over HTTP requestsconverter- the converter to use to read and write GraphQL payloads
-
-
Method Details
-
prepareResponse
protected ServerResponse prepareResponse(ServerRequest request, reactor.core.publisher.Mono<WebGraphQlResponse> responseMono) Description copied from class:AbstractGraphQlHttpHandlerPrepare theServerResponsefor the given GraphQL response.- Specified by:
prepareResponsein classAbstractGraphQlHttpHandler- Parameters:
request- the current requestresponseMono- the GraphQL response- Returns:
- the server response
-