Interface WebGraphQlHandler.Builder
- Enclosing interface:
- WebGraphQlHandler
public static interface WebGraphQlHandler.Builder
Builder for a
WebGraphQlHandler
that executes a
WebGraphQlInterceptor
chain followed by a
ExecutionGraphQlService
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build theWebGraphQlHandler
instance.contextSnapshotFactory
(io.micrometer.context.ContextSnapshotFactory snapshotFactory) Configure theContextSnapshotFactory
instance 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
WebSocketGraphQlInterceptor
to handle data from the firstConnectionInit
message expected on a GraphQL over WebSocket session, as well as theComplete
message 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 theContextSnapshotFactory
instance 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 theWebGraphQlHandler
instance.- Returns:
- the built WebGraphQlHandler
-