Interface WebGraphQlInterceptor
- All Known Subinterfaces:
WebSocketGraphQlInterceptor
- All Known Implementing Classes:
PropagationWebGraphQlInterceptor
public interface WebGraphQlInterceptor
Interceptor for server handling of GraphQL over HTTP or WebSocket requests,
providing access to info about the underlying HTTP request or WebSocket
handshake, and allowing customization of the
ExecutionInput
and
the ExecutionResult
.
Interceptors are typically declared as beans in Spring configuration and
ordered as defined in ObjectProvider.orderedStream()
.
Supported for Spring MVC and WebFlux.
- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Contract for delegation to the rest of the chain. -
Method Summary
Modifier and TypeMethodDescriptiondefault WebGraphQlInterceptor
andThen
(WebGraphQlInterceptor nextInterceptor) Return a newWebGraphQlInterceptor
that invokes the current interceptor first and then the one that is passed in.default WebGraphQlInterceptor.Chain
apply
(WebGraphQlInterceptor.Chain chain) Apply this interceptor to the givenChain
resulting in an intercepted chain.reactor.core.publisher.Mono<WebGraphQlResponse>
intercept
(WebGraphQlRequest request, WebGraphQlInterceptor.Chain chain) Intercept a request and delegate to the rest of the chain including other interceptors and aExecutionGraphQlService
.
-
Method Details
-
intercept
reactor.core.publisher.Mono<WebGraphQlResponse> intercept(WebGraphQlRequest request, WebGraphQlInterceptor.Chain chain) Intercept a request and delegate to the rest of the chain including other interceptors and aExecutionGraphQlService
.- Parameters:
request
- the request which may be aWebSocketGraphQlRequest
when intercepting a GraphQL request over WebSocketchain
- the rest of the chain to execute the request- Returns:
- a
Mono
with the response
-
andThen
Return a newWebGraphQlInterceptor
that invokes the current interceptor first and then the one that is passed in.- Parameters:
nextInterceptor
- the interceptor to delegate to after the current- Returns:
- a new interceptor that chains the two
-
apply
Apply this interceptor to the givenChain
resulting in an intercepted chain.- Parameters:
chain
- the chain to add interception around- Returns:
- a new chain instance
-