Class GraphQlSseHandler
java.lang.Object
org.springframework.graphql.server.webflux.AbstractGraphQlHttpHandler
org.springframework.graphql.server.webflux.GraphQlSseHandler
GraphQL handler that supports the
GraphQL
Server-Sent Events Protocol and to be exposed as a WebFlux.fn endpoint via
RouterFunctions
.- Since:
- 1.3.0
- Author:
- Brian Clozel, Rossen Stoyanchev
-
Field Summary
Fields inherited from class org.springframework.graphql.server.webflux.AbstractGraphQlHttpHandler
logger
-
Constructor Summary
ConstructorDescriptionGraphQlSseHandler
(WebGraphQlHandler graphQlHandler) Constructor with the handler to delegate to, and no timeout by default, which results in never timing out.GraphQlSseHandler
(WebGraphQlHandler graphQlHandler, Duration timeout) Variant constructor with a timeout to use for SSE subscriptions. -
Method Summary
Modifier and TypeMethodDescriptionprotected reactor.core.publisher.Mono<ServerResponse>
prepareResponse
(ServerRequest request, WebGraphQlResponse response) Prepare theServerResponse
for the given GraphQL response.Methods inherited from class org.springframework.graphql.server.webflux.AbstractGraphQlHttpHandler
encode, encodeResponseIfNecessary, handleRequest
-
Constructor Details
-
GraphQlSseHandler
Constructor with the handler to delegate to, and no timeout by default, which results in never timing out.- 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 use ornull
to never time out- Since:
- 1.3.3
-
-
Method Details
-
prepareResponse
protected reactor.core.publisher.Mono<ServerResponse> prepareResponse(ServerRequest request, WebGraphQlResponse response) Description copied from class:AbstractGraphQlHttpHandler
Prepare theServerResponse
for the given GraphQL response.- Specified by:
prepareResponse
in classAbstractGraphQlHttpHandler
- Parameters:
request
- the current requestresponse
- the GraphQL response- Returns:
- the server response
-