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>> |
beginCompleteFieldList(InstrumentationFieldCompleteParameters parameters)
This is called just before the complete field list is started and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
InstrumentationContext<ExecutionResult> |
beginDataFetch(InstrumentationDataFetchParameters parameters)
This is called just before the data fetching stage is started, waits for all data to be completed and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
InstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> |
beginDataFetchDispatch(InstrumentationDataFetchParameters parameters)
This is called just before the data fetching stage is started and finishes as soon as the query is dispatched ready for completion.
|
InstrumentationContext<java.util.Map<java.lang.String,java.util.List<Field>>> |
beginFields(InstrumentationExecutionStrategyParameters parameters)
This is called just before a selection set of fields is resolved and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
InstrumentationState |
createState()
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
|
beginCompleteField, beginExecution, beginExecutionStrategy, beginField, beginFieldFetch, beginParse, beginValidation, instrumentExecutionContext, instrumentSchemaclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinstrumentExecutionInputpublic 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 InstrumentationState createState()
InstrumentationcreateState in interface InstrumentationcreateState in class NoOpInstrumentationpublic 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 NoOpInstrumentationdataFetcher - the data fetcher about to be usedparameters - the parameters describing the field to be fetchedpublic InstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> beginDataFetchDispatch(InstrumentationDataFetchParameters parameters)
InstrumentationInstrumentation.beginDataFetch(graphql.execution.instrumentation.parameters.InstrumentationDataFetchParameters)
in that this step does not wait for the values to be completed, only dispatched for completion.beginDataFetchDispatch in interface InstrumentationbeginDataFetchDispatch in class NoOpInstrumentationparameters - the parameters to this stepInstrumentationContext object that will be called back when the step endspublic InstrumentationContext<ExecutionResult> beginDataFetch(InstrumentationDataFetchParameters parameters)
InstrumentationInstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.beginDataFetch in interface InstrumentationbeginDataFetch in class NoOpInstrumentationparameters - the parameters to this stepInstrumentationContext object that will be called back when the step endspublic InstrumentationContext<java.util.Map<java.lang.String,java.util.List<Field>>> beginFields(InstrumentationExecutionStrategyParameters parameters)
InstrumentationInstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.beginFields in interface InstrumentationbeginFields in class NoOpInstrumentationparameters - the parameters to this stepInstrumentationContext object that will be called back when the step endspublic InstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> beginCompleteFieldList(InstrumentationFieldCompleteParameters parameters)
InstrumentationInstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.beginCompleteFieldList in interface InstrumentationbeginCompleteFieldList 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)
InstrumentationinstrumentExecutionResult in interface InstrumentationinstrumentExecutionResult in class NoOpInstrumentationexecutionResult - CompletableFuture of the result to instrumentparameters - the parameters to this step