public class DataLoaderDispatcherInstrumentation extends NoOpInstrumentation
Instrumentation will dispatch
all the contained DataLoaders when each level of the graphql
query is executed.
This allows you to use DataLoaders in your DataFetchers
to optimal loading of data.DataLoader,
DataLoaderRegistryNoOpInstrumentation.NoOpInstrumentationContext<T>INSTANCE| Constructor and Description |
|---|
DataLoaderDispatcherInstrumentation(org.dataloader.DataLoaderRegistry dataLoaderRegistry)
You pass in a registry of N data loaders which will be
dispatched as
each level of the query executes. |
DataLoaderDispatcherInstrumentation(org.dataloader.DataLoaderRegistry dataLoaderRegistry,
DataLoaderDispatcherInstrumentationOptions options)
You pass in a registry of N data loaders which will be
dispatched as
each level of the query executes. |
| Modifier and Type | Method and Description |
|---|---|
InstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> |
beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
This is called each time the
ExecutionStrategy is invoked and when the
CompletableFuture has been dispatched for the query fields the
InstrumentationContext.onEnd(Object, Throwable)
is called. |
java.util.concurrent.CompletableFuture<ExecutionResult> |
instrumentExecutionResult(ExecutionResult executionResult,
InstrumentationExecutionParameters parameters)
This is called to allow instrumentation to instrument the execution result in some way
|
beginDataFetch, beginExecution, beginField, beginFieldFetch, beginParse, beginValidationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateState, instrumentDataFetcherpublic DataLoaderDispatcherInstrumentation(org.dataloader.DataLoaderRegistry dataLoaderRegistry)
dispatched as
each level of the query executes.dataLoaderRegistry - the registry of data loaders that will be dispatchedpublic DataLoaderDispatcherInstrumentation(org.dataloader.DataLoaderRegistry dataLoaderRegistry,
DataLoaderDispatcherInstrumentationOptions options)
dispatched as
each level of the query executes.dataLoaderRegistry - the registry of data loaders that will be dispatchedoptions - the options to control the behaviourpublic InstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
InstrumentationExecutionStrategy is invoked and when the
CompletableFuture has been dispatched for the query fields the
InstrumentationContext.onEnd(Object, Throwable)
is called.
Note because the execution strategy execution is asynchronous, the query data is not guaranteed to be
completed when this step finishes. It is however a chance to dispatch side effects that might cause
asynchronous data fetching code to actually run or attach CompletableFuture handlers onto the result
via Instrumentation.beginExecutionStrategy in interface InstrumentationbeginExecutionStrategy in class NoOpInstrumentationparameters - the parameters to this stepInstrumentationContext object that will be called back when the step endspublic java.util.concurrent.CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters)
InstrumentationexecutionResult - CompletableFuture of the result to instrumentparameters - the parameters to this step