@PublicApi public interface FieldValidationEnvironment
getFieldsByPath()
will be where most of the useful validation information is
contained. It also gives you a helper to make validation error messages.
One thing to note is that because queries can have repeating fragments, the same
logical field can appear multiple times with different input values. That is
why getFieldsByPath()
returns a list of fields and their arguments.
if you don't have fragments then the list will be of size 1FieldAndArguments
Modifier and Type | Method and 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.
|
ExecutionContext getExecutionContext()
java.util.List<FieldAndArguments> getFields()
FieldAndArguments
java.util.Map<ResultPath,java.util.List<FieldAndArguments>> getFieldsByPath()
FieldAndArguments
GraphQLError mkError(java.lang.String msg)
GraphQLError
is validmsg
- the error messageGraphQLError mkError(java.lang.String msg, FieldAndArguments fieldAndArguments)
GraphQLError
is validmsg
- the error messagefieldAndArguments
- the field in error