Class DataLoaderDispatchingContextKeys
java.lang.Object
graphql.execution.instrumentation.dataloader.DataLoaderDispatchingContextKeys
GraphQLContext keys related to DataLoader dispatching.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
In nano seconds, the batch window size for delayed DataLoaders.static final String
An instance ofDelayedDataLoaderDispatcherExecutorFactory
that is used to create theScheduledExecutorService
for the delayed DataLoader dispatching.static final String
Enables the ability to chain DataLoader dispatching. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
setDelayedDataLoaderBatchWindowSize
(GraphQLContext graphQLContext, 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 Details
-
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:
-
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:
-
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:
-
-
Method Details
-
setEnableDataLoaderChaining
Enables the ability that chained DataLoaders are dispatched automatically.- Parameters:
graphQLContext
-
-
setDelayedDataLoaderBatchWindowSize
public static void setDelayedDataLoaderBatchWindowSize(GraphQLContext graphQLContext, 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
-
-