Class FieldValidationSupport.FieldValidationEnvironmentImpl
java.lang.Object
graphql.execution.instrumentation.fieldvalidation.FieldValidationSupport.FieldValidationEnvironmentImpl
- All Implemented Interfaces:
FieldValidationEnvironment
- Enclosing class:
FieldValidationSupport
private static class FieldValidationSupport.FieldValidationEnvironmentImpl
extends Object
implements FieldValidationEnvironment
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ExecutionContextprivate final com.google.common.collect.ImmutableList<FieldAndArguments> private final Map<ResultPath, List<FieldAndArguments>> -
Constructor Summary
ConstructorsConstructorDescriptionFieldValidationEnvironmentImpl(ExecutionContext executionContext, Map<ResultPath, List<FieldAndArguments>> fieldArgumentsMap) -
Method Summary
Modifier and TypeMethodDescriptionThis helper method allows you to make error messages to be passed back out in case of validation failure.mkError(String msg, FieldAndArguments fieldAndArguments) This helper method allows you to make error messages to be passed back out in case of validation failure.
-
Field Details
-
executionContext
-
fieldArgumentsMap
-
fieldArguments
-
-
Constructor Details
-
FieldValidationEnvironmentImpl
FieldValidationEnvironmentImpl(ExecutionContext executionContext, Map<ResultPath, List<FieldAndArguments>> fieldArgumentsMap)
-
-
Method Details
-
getExecutionContext
- Specified by:
getExecutionContextin interfaceFieldValidationEnvironment- Returns:
- the schema in play
-
getFields
- Specified by:
getFieldsin interfaceFieldValidationEnvironment- Returns:
- a list of
FieldAndArguments
-
getFieldsByPath
- Specified by:
getFieldsByPathin interfaceFieldValidationEnvironment- Returns:
- a map of field paths to
FieldAndArguments
-
mkError
Description copied from interface:FieldValidationEnvironmentThis helper method allows you to make error messages to be passed back out in case of validation failure. Note you don't NOT have to use this helper. Any implementation ofGraphQLErroris valid- Specified by:
mkErrorin interfaceFieldValidationEnvironment- Parameters:
msg- the error message- Returns:
- a graphql error
-
mkError
Description copied from interface:FieldValidationEnvironmentThis helper method allows you to make error messages to be passed back out in case of validation failure. Note you don't NOT have to use this helper. Any implementation ofGraphQLErroris valid- Specified by:
mkErrorin interfaceFieldValidationEnvironment- Parameters:
msg- the error messagefieldAndArguments- the field in error- Returns:
- a graphql error
-