Class FieldValidationInstrumentation
- java.lang.Object
-
- graphql.execution.instrumentation.SimplePerformantInstrumentation
-
- graphql.execution.instrumentation.fieldvalidation.FieldValidationInstrumentation
-
- All Implemented Interfaces:
Instrumentation
@PublicApi public class FieldValidationInstrumentation extends SimplePerformantInstrumentation
ThisInstrumentation
allows you to validate the fields of the query before the query is executed. You need to provide an implementation ofFieldValidation
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:
FieldValidation
-
-
Field Summary
-
Fields inherited from class graphql.execution.instrumentation.SimplePerformantInstrumentation
INSTANCE
-
-
Constructor Summary
Constructors Constructor Description FieldValidationInstrumentation(FieldValidation fieldValidation)
Your field validation will be called before query execution
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @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, instrumentSchema
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface graphql.execution.instrumentation.Instrumentation
beginDeferredField, beginFieldFetching
-
-
-
-
Constructor Detail
-
FieldValidationInstrumentation
public FieldValidationInstrumentation(FieldValidation fieldValidation)
Your field validation will be called before query execution- Parameters:
fieldValidation
- the field validation to call
-
-
Method Detail
-
beginExecuteOperation
@Nullable public @Nullable InstrumentationContext<ExecutionResult> beginExecuteOperation(InstrumentationExecuteOperationParameters parameters, InstrumentationState state)
Description copied from interface:Instrumentation
This is called just before the execution of the query operation is started.- Specified by:
beginExecuteOperation
in interfaceInstrumentation
- Overrides:
beginExecuteOperation
in classSimplePerformantInstrumentation
- Parameters:
parameters
- the parameters to this stepstate
- the state created during the call toInstrumentation.createStateAsync(InstrumentationCreateStateParameters)
- Returns:
- a nullable
InstrumentationContext
object that will be called back when the step ends (assuming it's not null)
-
-