public class DataLoaderDispatcherInstrumentation extends SimpleInstrumentation
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.
A DataLoaderDispatcherInstrumentation will be automatically added to the GraphQL
instrumentation list if one is not present.
DataLoader,
DataLoaderRegistryINSTANCE| Constructor and Description |
|---|
DataLoaderDispatcherInstrumentation()
Creates a DataLoaderDispatcherInstrumentation with the default options
|
DataLoaderDispatcherInstrumentation(DataLoaderDispatcherInstrumentationOptions options)
Creates a DataLoaderDispatcherInstrumentation with the specified options
|
| Modifier and Type | Method and Description |
|---|---|
DeferredFieldInstrumentationContext |
beginDeferredField(InstrumentationDeferredFieldParameters parameters)
This is called just before a deferred field is resolved into a value.
|
InstrumentationContext<ExecutionResult> |
beginExecuteOperation(InstrumentationExecuteOperationParameters parameters)
This is called just before the execution of the query operation is started.
|
ExecutionStrategyInstrumentationContext |
beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
This is called each time an
ExecutionStrategy is invoked, which may be multiple times
per query as the engine recursively descends down over the query. |
InstrumentationContext<java.lang.Object> |
beginFieldFetch(InstrumentationFieldFetchParameters parameters)
This is called just before a field
DataFetcher is invoked. |
InstrumentationState |
createState(InstrumentationCreateStateParameters parameters)
This will be called just before execution to create an object that is given back to all instrumentation methods
to allow them to have per execution request state
|
DataFetcher<?> |
instrumentDataFetcher(DataFetcher<?> dataFetcher,
InstrumentationFieldFetchParameters parameters)
This is called to instrument a
DataFetcher just before it is used to fetch a field, allowing you
to adjust what information is passed back or record information about specific data fetches. |
java.util.concurrent.CompletableFuture<ExecutionResult> |
instrumentExecutionResult(ExecutionResult executionResult,
InstrumentationExecutionParameters parameters)
This is called to allow instrumentation to instrument the execution result in some way
|
beginExecution, beginField, beginFieldComplete, beginFieldListComplete, beginParse, beginValidation, createState, instrumentExecutionContext, instrumentSchemaclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinstrumentExecutionInputpublic DataLoaderDispatcherInstrumentation()
public DataLoaderDispatcherInstrumentation(DataLoaderDispatcherInstrumentationOptions options)
options - the options to control the behaviourpublic InstrumentationState createState(InstrumentationCreateStateParameters parameters)
Instrumentationparameters - the parameters to this steppublic DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters)
InstrumentationDataFetcher just before it is used to fetch a field, allowing you
to adjust what information is passed back or record information about specific data fetches. Note
the same data fetcher instance maybe presented to you many times and that data fetcher
implementations widely vary.instrumentDataFetcher in interface InstrumentationinstrumentDataFetcher in class SimpleInstrumentationdataFetcher - the data fetcher about to be usedparameters - the parameters describing the field to be fetchedpublic InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters)
InstrumentationbeginExecuteOperation in interface InstrumentationbeginExecuteOperation in class SimpleInstrumentationparameters - the parameters to this stepInstrumentationContext object that will be called back when the step endspublic ExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
InstrumentationExecutionStrategy is invoked, which may be multiple times
per query as the engine recursively descends down over the query.beginExecutionStrategy in interface InstrumentationbeginExecutionStrategy in class SimpleInstrumentationparameters - the parameters to this stepInstrumentationContext object that will be called back when the step endspublic DeferredFieldInstrumentationContext beginDeferredField(InstrumentationDeferredFieldParameters parameters)
InstrumentationbeginDeferredField in interface InstrumentationbeginDeferredField in class SimpleInstrumentationparameters - the parameters to this stepInstrumentationContext object that will be called back when the step endspublic InstrumentationContext<java.lang.Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters)
InstrumentationDataFetcher is invoked.beginFieldFetch in interface InstrumentationbeginFieldFetch in class SimpleInstrumentationparameters - 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)
InstrumentationinstrumentExecutionResult in interface InstrumentationinstrumentExecutionResult in class SimpleInstrumentationexecutionResult - CompletableFuture of the result to instrumentparameters - the parameters to this step