Class GraphQlSseHandler
java.lang.Object
org.springframework.graphql.server.webmvc.AbstractGraphQlHttpHandler
org.springframework.graphql.server.webmvc.GraphQlSseHandler
GraphQL handler that supports the
GraphQL
Server-Sent Events Protocol and to be exposed as a WebMvc functional endpoint via
RouterFunctions
.- Since:
- 1.3.0
- Author:
- Brian Clozel, Rossen Stoyanchev
-
Field Summary
Fields inherited from class org.springframework.graphql.server.webmvc.AbstractGraphQlHttpHandler
logger
-
Constructor Summary
ConstructorDescriptionGraphQlSseHandler
(WebGraphQlHandler graphQlHandler) Constructor with the handler to delegate to, and no timeout, i.e.GraphQlSseHandler
(WebGraphQlHandler graphQlHandler, Duration timeout) Variant constructor with a timeout to use for SSE subscriptions. -
Method Summary
Modifier and TypeMethodDescriptionprotected ServerResponse
prepareResponse
(ServerRequest request, reactor.core.publisher.Mono<WebGraphQlResponse> responseMono) Prepare theServerResponse
for the given GraphQL response.Methods inherited from class org.springframework.graphql.server.webmvc.AbstractGraphQlHttpHandler
getWriteFunction, handleRequest
-
Constructor Details
-
GraphQlSseHandler
Constructor with the handler to delegate to, and no timeout, i.e. relying on underlying Server async request timeout.- Parameters:
graphQlHandler
- the handler to delegate to
-
GraphQlSseHandler
Variant constructor with a timeout to use for SSE subscriptions.- Parameters:
graphQlHandler
- the handler to delegate totimeout
- the timeout value to set onAsyncWebRequest.setTimeout(Long)
- Since:
- 1.3.3
-
-
Method Details
-
prepareResponse
protected ServerResponse prepareResponse(ServerRequest request, reactor.core.publisher.Mono<WebGraphQlResponse> responseMono) Description copied from class:AbstractGraphQlHttpHandler
Prepare theServerResponse
for the given GraphQL response.- Specified by:
prepareResponse
in classAbstractGraphQlHttpHandler
- Parameters:
request
- the current requestresponseMono
- the GraphQL response- Returns:
- the server response
-