Class DataLoaderDispatchingContextKeys


  • @NullMarked
    public final class DataLoaderDispatchingContextKeys
    extends java.lang.Object
    GraphQLContext keys related to DataLoader dispatching.
    • 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 of DelayedDataLoaderDispatcherExecutorFactory that is used to create the ScheduledExecutorService 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 -