Class DataLoaderDispatchingContextKeys
java.lang.Object
graphql.execution.instrumentation.dataloader.DataLoaderDispatchingContextKeys
GraphQLContext keys related to DataLoader dispatching.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIn nano seconds, the batch window size for delayed DataLoaders.static final StringAn instance ofDelayedDataLoaderDispatcherExecutorFactorythat is used to create theScheduledExecutorServicefor the delayed DataLoader dispatching.static final StringEnables the ability to chain DataLoader dispatching. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsetDelayedDataLoaderBatchWindowSize(GraphQLContext graphQLContext, Duration batchWindowSize) Sets nanoseconds the batch window duration size for delayed DataLoaders.static voidsetDelayedDataLoaderDispatchingExecutorFactory(GraphQLContext graphQLContext, DelayedDataLoaderDispatcherExecutorFactory delayedDataLoaderDispatcherExecutorFactory) Sets the instance ofDelayedDataLoaderDispatcherExecutorFactorythat is used to create theScheduledExecutorServicefor the delayed DataLoader dispatching.static voidsetEnableDataLoaderChaining(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 ofDelayedDataLoaderDispatcherExecutorFactorythat is used to create theScheduledExecutorServicefor 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 ofDelayedDataLoaderDispatcherExecutorFactorythat is used to create theScheduledExecutorServicefor the delayed DataLoader dispatching.- Parameters:
graphQLContext-delayedDataLoaderDispatcherExecutorFactory-
-