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 java.lang.Object implements FieldValidationEnvironment
-
-
Field Summary
Fields Modifier and Type Field Description private ExecutionContext
executionContext
private com.google.common.collect.ImmutableList<FieldAndArguments>
fieldArguments
private java.util.Map<ResultPath,java.util.List<FieldAndArguments>>
fieldArgumentsMap
-
Constructor Summary
Constructors Constructor Description FieldValidationEnvironmentImpl(ExecutionContext executionContext, java.util.Map<ResultPath,java.util.List<FieldAndArguments>> fieldArgumentsMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutionContext
getExecutionContext()
java.util.List<FieldAndArguments>
getFields()
java.util.Map<ResultPath,java.util.List<FieldAndArguments>>
getFieldsByPath()
GraphQLError
mkError(java.lang.String msg)
This helper method allows you to make error messages to be passed back out in case of validation failure.GraphQLError
mkError(java.lang.String msg, FieldAndArguments fieldAndArguments)
This helper method allows you to make error messages to be passed back out in case of validation failure.
-
-
-
Field Detail
-
executionContext
private final ExecutionContext executionContext
-
fieldArgumentsMap
private final java.util.Map<ResultPath,java.util.List<FieldAndArguments>> fieldArgumentsMap
-
fieldArguments
private final com.google.common.collect.ImmutableList<FieldAndArguments> fieldArguments
-
-
Constructor Detail
-
FieldValidationEnvironmentImpl
FieldValidationEnvironmentImpl(ExecutionContext executionContext, java.util.Map<ResultPath,java.util.List<FieldAndArguments>> fieldArgumentsMap)
-
-
Method Detail
-
getExecutionContext
public ExecutionContext getExecutionContext()
- Specified by:
getExecutionContext
in interfaceFieldValidationEnvironment
- Returns:
- the schema in play
-
getFields
public java.util.List<FieldAndArguments> getFields()
- Specified by:
getFields
in interfaceFieldValidationEnvironment
- Returns:
- a list of
FieldAndArguments
-
getFieldsByPath
public java.util.Map<ResultPath,java.util.List<FieldAndArguments>> getFieldsByPath()
- Specified by:
getFieldsByPath
in interfaceFieldValidationEnvironment
- Returns:
- a map of field paths to
FieldAndArguments
-
mkError
public GraphQLError mkError(java.lang.String msg)
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
public GraphQLError mkError(java.lang.String msg, FieldAndArguments fieldAndArguments)
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
-
-