public interface Instrumentation
Modifier and Type | Method and Description |
---|---|
default InstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> |
beginCompleteField(InstrumentationFieldCompleteParameters parameters)
This is called just before the complete field is started and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
default 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. |
default 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<ExecutionResult> |
beginExecution(InstrumentationExecutionParameters parameters)
This is called just before a query is executed 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>> |
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. |
InstrumentationContext<ExecutionResult> |
beginField(InstrumentationFieldParameters parameters)
This is called just before a field is resolved and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
InstrumentationContext<java.lang.Object> |
beginFieldFetch(InstrumentationFieldFetchParameters parameters)
This is called just before a field
DataFetcher is invoked and when this step finishes the InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
default 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. |
InstrumentationContext<Document> |
beginParse(InstrumentationExecutionParameters parameters)
This is called just before a query is parsed and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
InstrumentationContext<java.util.List<ValidationError>> |
beginValidation(InstrumentationValidationParameters parameters)
This is called just before the parsed query Document is validated and when this step finishes the
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished. |
default 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
|
default 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. |
default ExecutionContext |
instrumentExecutionContext(ExecutionContext executionContext,
InstrumentationExecutionParameters parameters)
This is called to instrument a
ExecutionContext before it is used to execute a query,
allowing you to adjust the base data used. |
default ExecutionInput |
instrumentExecutionInput(ExecutionInput executionInput,
InstrumentationExecutionParameters parameters)
This is called to instrument a
ExecutionInput before it is used to parse, validate
and execute a query, allowing you to adjust what query input parameters are used |
default java.util.concurrent.CompletableFuture<ExecutionResult> |
instrumentExecutionResult(ExecutionResult executionResult,
InstrumentationExecutionParameters parameters)
This is called to allow instrumentation to instrument the execution result in some way
|
default GraphQLSchema |
instrumentSchema(GraphQLSchema schema,
InstrumentationExecutionParameters parameters)
This is called to instrument a
GraphQLSchema before it is used to parse, validate
and execute a query, allowing you to adjust what types are used. |
default InstrumentationState createState()
InstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<java.util.List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsdefault InstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> beginDataFetchDispatch(InstrumentationDataFetchParameters parameters)
beginDataFetch(graphql.execution.instrumentation.parameters.InstrumentationDataFetchParameters)
in that this step does not wait for the values to be completed, only dispatched for completion.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<ExecutionResult> beginDataFetch(InstrumentationDataFetchParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
ExecutionStrategy
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.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsdefault InstrumentationContext<java.util.Map<java.lang.String,java.util.List<Field>>> beginFields(InstrumentationExecutionStrategyParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<java.lang.Object> beginFieldFetch(InstrumentationFieldFetchParameters parameters)
DataFetcher
is invoked and when this step finishes the InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsdefault InstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> beginCompleteField(InstrumentationFieldCompleteParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsdefault InstrumentationContext<java.util.concurrent.CompletableFuture<ExecutionResult>> beginCompleteFieldList(InstrumentationFieldCompleteParameters parameters)
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsdefault ExecutionInput instrumentExecutionInput(ExecutionInput executionInput, InstrumentationExecutionParameters parameters)
ExecutionInput
before it is used to parse, validate
and execute a query, allowing you to adjust what query input parameters are usedexecutionInput
- the execution input to be usedparameters
- the parameters describing the field to be fetcheddefault GraphQLSchema instrumentSchema(GraphQLSchema schema, InstrumentationExecutionParameters parameters)
GraphQLSchema
before it is used to parse, validate
and execute a query, allowing you to adjust what types are used.schema
- the schema to be usedparameters
- the parameters describing the field to be fetcheddefault ExecutionContext instrumentExecutionContext(ExecutionContext executionContext, InstrumentationExecutionParameters parameters)
ExecutionContext
before it is used to execute a query,
allowing you to adjust the base data used.executionContext
- the execution context to be usedparameters
- the parameters describing the field to be fetcheddefault DataFetcher<?> instrumentDataFetcher(DataFetcher<?> dataFetcher, InstrumentationFieldFetchParameters parameters)
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. Note
the same data fetcher instance maybe presented to you many times and that data fetcher
implementations widely vary.dataFetcher
- the data fetcher about to be usedparameters
- the parameters describing the field to be fetcheddefault java.util.concurrent.CompletableFuture<ExecutionResult> instrumentExecutionResult(ExecutionResult executionResult, InstrumentationExecutionParameters parameters)
executionResult
- CompletableFuture
of the result to instrumentparameters
- the parameters to this step