public interface Instrumentation
InstrumentationContext
object. This has two callbacks on it,
one for the step is `dispatched` and one for when the step has `completed`. This is done because many of the "steps" are asynchronous
operations such as fetching data and resolving it into objects.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.
|
InstrumentationContext<ExecutionResult> |
beginExecution(InstrumentationExecutionParameters parameters)
This is called right at the start of query execution and its the first step in the instrumentation chain.
|
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<ExecutionResult> |
beginField(InstrumentationFieldParameters parameters)
This is called just before a field is resolved into a value.
|
default InstrumentationContext<ExecutionResult> |
beginFieldComplete(InstrumentationFieldCompleteParameters parameters)
This is called just before the complete field is started.
|
InstrumentationContext<java.lang.Object> |
beginFieldFetch(InstrumentationFieldFetchParameters parameters)
This is called just before a field
DataFetcher is invoked. |
default InstrumentationContext<ExecutionResult> |
beginFieldListComplete(InstrumentationFieldCompleteParameters parameters)
This is called just before the complete field list is started.
|
InstrumentationContext<Document> |
beginParse(InstrumentationExecutionParameters parameters)
This is called just before a query is parsed.
|
InstrumentationContext<java.util.List<ValidationError>> |
beginValidation(InstrumentationValidationParameters parameters)
This is called just before the parsed query document is validated.
|
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 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
|
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 DocumentAndVariables |
instrumentDocumentAndVariables(DocumentAndVariables documentAndVariables,
InstrumentationExecutionParameters parameters)
This is called to instrument a
Document and variables before it is used allowing you to adjust the query AST if you so desire |
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()
default InstrumentationState createState(InstrumentationCreateStateParameters parameters)
parameters
- the parameters to this stepInstrumentationContext<ExecutionResult> beginExecution(InstrumentationExecutionParameters parameters)
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<Document> beginParse(InstrumentationExecutionParameters parameters)
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<java.util.List<ValidationError>> beginValidation(InstrumentationValidationParameters parameters)
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters)
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsExecutionStrategyInstrumentationContext beginExecutionStrategy(InstrumentationExecutionStrategyParameters parameters)
ExecutionStrategy
is invoked, which may be multiple times
per query as the engine recursively descends down over the query.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsDeferredFieldInstrumentationContext beginDeferredField(InstrumentationDeferredFieldParameters parameters)
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsInstrumentationContext<ExecutionResult> beginField(InstrumentationFieldParameters parameters)
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.parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsdefault InstrumentationContext<ExecutionResult> beginFieldComplete(InstrumentationFieldCompleteParameters parameters)
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step endsdefault InstrumentationContext<ExecutionResult> beginFieldListComplete(InstrumentationFieldCompleteParameters parameters)
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 DocumentAndVariables instrumentDocumentAndVariables(DocumentAndVariables documentAndVariables, InstrumentationExecutionParameters parameters)
Document
and variables before it is used allowing you to adjust the query AST if you so desiredocumentAndVariables
- the document and variables to be usedparameters
- the parameters describing the executiondefault 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