Interface WebGraphQlHandler.Builder
- Enclosing interface:
WebGraphQlHandler
public static interface WebGraphQlHandler.Builder
Builder for a
WebGraphQlHandler that executes a
WebGraphQlInterceptor chain followed by a
ExecutionGraphQlService.- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theWebGraphQlHandlerinstance.contextSnapshotFactory(io.micrometer.context.ContextSnapshotFactory snapshotFactory) Configure theContextSnapshotFactoryinstance to use for context propagation ofThreadLocal, and Reactor context values from the transport layer to the GraphQL execution layer.interceptor(WebGraphQlInterceptor... interceptors) Configure interceptors to be invoked before the targetGraphQlService.interceptors(List<WebGraphQlInterceptor> interceptors) Alternative tointerceptor(WebGraphQlInterceptor...)with a List.
-
Method Details
-
interceptor
Configure interceptors to be invoked before the targetGraphQlService.One of the interceptors can be of type
WebSocketGraphQlInterceptorto handle data from the firstConnectionInitmessage expected on a GraphQL over WebSocket session, as well as theCompletemessage expected at the end of a session.- Parameters:
interceptors- the interceptors to add- Returns:
- this builder
-
interceptors
Alternative tointerceptor(WebGraphQlInterceptor...)with a List.- Parameters:
interceptors- the list of interceptors to add- Returns:
- this builder
-
contextSnapshotFactory
WebGraphQlHandler.Builder contextSnapshotFactory(io.micrometer.context.ContextSnapshotFactory snapshotFactory) Configure theContextSnapshotFactoryinstance to use for context propagation ofThreadLocal, and Reactor context values from the transport layer to the GraphQL execution layer. If not set, then a default instance is used.- Parameters:
snapshotFactory- the factory to use- Since:
- 1.3.0
-
build
WebGraphQlHandler build()Build theWebGraphQlHandlerinstance.- Returns:
- the built WebGraphQlHandler
-