Class DataLoaderDispatchingContextKeys
- java.lang.Object
-
- graphql.execution.instrumentation.dataloader.DataLoaderDispatchingContextKeys
-
@NullMarked public final class DataLoaderDispatchingContextKeys extends java.lang.Object
GraphQLContext keys related to DataLoader dispatching.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DELAYED_DATA_LOADER_BATCH_WINDOW_SIZE_NANO_SECONDS
In nano seconds, the batch window size for delayed DataLoaders.static java.lang.String
DELAYED_DATA_LOADER_DISPATCHING_EXECUTOR_FACTORY
An instance ofDelayedDataLoaderDispatcherExecutorFactory
that is used to create theScheduledExecutorService
for the delayed DataLoader dispatching.static java.lang.String
ENABLE_DATA_LOADER_CHAINING
Enables the ability to chain DataLoader dispatching.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
setDelayedDataLoaderBatchWindowSize(GraphQLContext graphQLContext, java.time.Duration batchWindowSize)
Sets nanoseconds the batch window duration size for delayed DataLoaders.static void
setDelayedDataLoaderDispatchingExecutorFactory(GraphQLContext graphQLContext, DelayedDataLoaderDispatcherExecutorFactory delayedDataLoaderDispatcherExecutorFactory)
Sets the instance ofDelayedDataLoaderDispatcherExecutorFactory
that is used to create theScheduledExecutorService
for the delayed DataLoader dispatching.static void
setEnableDataLoaderChaining(GraphQLContext graphQLContext, boolean enabled)
Enables the ability that chained DataLoaders are dispatched automatically.
-
-
-
Field Detail
-
DELAYED_DATA_LOADER_BATCH_WINDOW_SIZE_NANO_SECONDS
public static final java.lang.String DELAYED_DATA_LOADER_BATCH_WINDOW_SIZE_NANO_SECONDS
In nano seconds, the batch window size for delayed DataLoaders. That is for DataLoaders, that are not batched as part of the normal per level dispatching, because they were created after the level was already dispatched.Expect Long values
Default is 500_000 (0.5 ms)
- See Also:
- Constant Field Values
-
DELAYED_DATA_LOADER_DISPATCHING_EXECUTOR_FACTORY
public static final java.lang.String DELAYED_DATA_LOADER_DISPATCHING_EXECUTOR_FACTORY
An instance ofDelayedDataLoaderDispatcherExecutorFactory
that is used to create theScheduledExecutorService
for the delayed DataLoader dispatching.Default is one static executor thread pool with a single thread.
- See Also:
- Constant Field Values
-
ENABLE_DATA_LOADER_CHAINING
public static final java.lang.String ENABLE_DATA_LOADER_CHAINING
Enables the ability to chain DataLoader dispatching.Because this requires that all DataLoaders are accessed via DataFetchingEnvironment.getLoader() this is not completely backwards compatible and therefore disabled by default.
Expects a boolean value.
- See Also:
- Constant Field Values
-
-
Method Detail
-
setEnableDataLoaderChaining
public static void setEnableDataLoaderChaining(GraphQLContext graphQLContext, boolean enabled)
Enables the ability that chained DataLoaders are dispatched automatically.- Parameters:
graphQLContext
-
-
setDelayedDataLoaderBatchWindowSize
public static void setDelayedDataLoaderBatchWindowSize(GraphQLContext graphQLContext, java.time.Duration batchWindowSize)
Sets nanoseconds the batch window duration size for delayed DataLoaders. That is for DataLoaders, that are not batched as part of the normal per level dispatching, because they were created after the level was already dispatched.- Parameters:
graphQLContext
-batchWindowSize
-
-
setDelayedDataLoaderDispatchingExecutorFactory
public static void setDelayedDataLoaderDispatchingExecutorFactory(GraphQLContext graphQLContext, DelayedDataLoaderDispatcherExecutorFactory delayedDataLoaderDispatcherExecutorFactory)
Sets the instance ofDelayedDataLoaderDispatcherExecutorFactory
that is used to create theScheduledExecutorService
for the delayed DataLoader dispatching.- Parameters:
graphQLContext
-delayedDataLoaderDispatcherExecutorFactory
-
-
-