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 ExecutionContext
private 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:
getExecutionContext
in interfaceFieldValidationEnvironment
- Returns:
- the schema in play
-
getFields
- Specified by:
getFields
in interfaceFieldValidationEnvironment
- Returns:
- a list of
FieldAndArguments
-
getFieldsByPath
- Specified by:
getFieldsByPath
in interfaceFieldValidationEnvironment
- Returns:
- a map of field paths to
FieldAndArguments
-
mkError
Description copied from interface:FieldValidationEnvironment
This 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 ofGraphQLError
is valid- Specified by:
mkError
in interfaceFieldValidationEnvironment
- Parameters:
msg
- the error message- Returns:
- a graphql error
-
mkError
Description copied from interface:FieldValidationEnvironment
This 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 ofGraphQLError
is valid- Specified by:
mkError
in interfaceFieldValidationEnvironment
- Parameters:
msg
- the error messagefieldAndArguments
- the field in error- Returns:
- a graphql error
-