Interface WebGraphQlInterceptor
- All Known Subinterfaces:
WebSocketGraphQlInterceptor
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 interfaceContract for delegation to the rest of the chain. -
Method Summary
Modifier and TypeMethodDescriptiondefault WebGraphQlInterceptorandThen(WebGraphQlInterceptor nextInterceptor) Return a newWebGraphQlInterceptorthat invokes the current interceptor first and then the one that is passed in.default WebGraphQlInterceptor.Chainapply(WebGraphQlInterceptor.Chain chain) Apply this interceptor to the givenChainresulting 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 aWebSocketGraphQlRequestwhen intercepting a GraphQL request over WebSocketchain- the rest of the chain to execute the request- Returns:
- a
Monowith the response
-
andThen
Return a newWebGraphQlInterceptorthat 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 givenChainresulting in an intercepted chain.- Parameters:
chain- the chain to add interception around- Returns:
- a new chain instance
-