@PublicApi public class FieldValidationInstrumentation extends NoOpInstrumentation
Instrumentation
allows you to validate the fields
of the query before the query is executed. You need to provide an implementation of
FieldValidation
that is called to validate fields. If it returns errors
then the query execution will be aborted and the errors will be returned
in the execution resultFieldValidation
NoOpInstrumentation.NoOpInstrumentationContext<T>
INSTANCE
Constructor and Description |
---|
FieldValidationInstrumentation(FieldValidation fieldValidation)
Your field validation will be called before query execution
|
Modifier and Type | Method and Description |
---|---|
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. |
beginCompleteField, beginCompleteFieldList, beginDataFetchDispatch, beginExecution, beginExecutionStrategy, beginField, beginFieldFetch, beginFields, beginParse, beginValidation, createState, instrumentDataFetcher, instrumentExecutionContext, instrumentExecutionResult, instrumentSchema
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
instrumentExecutionInput
public FieldValidationInstrumentation(FieldValidation fieldValidation)
fieldValidation
- the field validation to callpublic InstrumentationContext<ExecutionResult> beginDataFetch(InstrumentationDataFetchParameters parameters)
Instrumentation
InstrumentationContext.onEnd(Object, Throwable)
will be called indicating that the step has finished.beginDataFetch
in interface Instrumentation
beginDataFetch
in class NoOpInstrumentation
parameters
- the parameters to this stepInstrumentationContext
object that will be called back when the step ends