Class FieldValidationInstrumentation
java.lang.Object
graphql.execution.instrumentation.SimplePerformantInstrumentation
graphql.execution.instrumentation.fieldvalidation.FieldValidationInstrumentation
- All Implemented Interfaces:
Instrumentation
This
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 result- See Also:
-
Field Summary
Fields inherited from class graphql.execution.instrumentation.SimplePerformantInstrumentation
INSTANCE -
Constructor Summary
ConstructorsConstructorDescriptionFieldValidationInstrumentation(FieldValidation fieldValidation) Your field validation will be called before query execution -
Method Summary
Modifier and TypeMethodDescription@Nullable InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters, InstrumentationState state) This is called just before the execution of the query operation is started.Methods inherited from class graphql.execution.instrumentation.SimplePerformantInstrumentation
beginExecuteObject, beginExecution, beginExecutionStrategy, beginFieldCompletion, beginFieldExecution, beginFieldFetch, beginFieldListCompletion, beginParse, beginSubscribedFieldEvent, beginValidation, createState, createStateAsync, instrumentDataFetcher, instrumentDocumentAndVariables, instrumentExecutionContext, instrumentExecutionInput, instrumentExecutionResult, instrumentSchemaMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface graphql.execution.instrumentation.Instrumentation
beginDeferredField, beginFieldFetching, beginReactiveResults
-
Constructor Details
-
FieldValidationInstrumentation
Your field validation will be called before query execution- Parameters:
fieldValidation- the field validation to call
-
-
Method Details
-
beginExecuteOperation
public @Nullable InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters, InstrumentationState state) Description copied from interface:InstrumentationThis is called just before the execution of the query operation is started.- Specified by:
beginExecuteOperationin interfaceInstrumentation- Overrides:
beginExecuteOperationin classSimplePerformantInstrumentation- Parameters:
parameters- the parameters to this stepstate- the state created during the call toInstrumentation.createStateAsync(InstrumentationCreateStateParameters)- Returns:
- a nullable
InstrumentationContextobject that will be called back when the step ends (assuming it's not null)
-