Class DataLoaderDispatchingContextKeys

java.lang.Object
graphql.execution.instrumentation.dataloader.DataLoaderDispatchingContextKeys

@NullMarked public final class DataLoaderDispatchingContextKeys extends Object
GraphQLContext keys related to DataLoader dispatching.
  • Field Details

    • DELAYED_DATA_LOADER_BATCH_WINDOW_SIZE_NANO_SECONDS

      public static final 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:
    • DELAYED_DATA_LOADER_DISPATCHING_EXECUTOR_FACTORY

      public static final 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:
    • ENABLE_DATA_LOADER_CHAINING

      public static final 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:
  • Method Details

    • 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, 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 of DelayedDataLoaderDispatcherExecutorFactory that is used to create the ScheduledExecutorService for the delayed DataLoader dispatching.

      Parameters:
      graphQLContext -
      delayedDataLoaderDispatcherExecutorFactory -