@PublicSpi
public interface ValidationRule
ValidationEnvironment and produce
a list of zero or more GraphQLErrors as validation.| Modifier and Type | Method and Description |
|---|---|
boolean |
appliesTo(graphql.schema.GraphQLArgument argument,
graphql.schema.GraphQLFieldDefinition fieldDefinition,
graphql.schema.GraphQLFieldsContainer fieldsContainer)
This is called to work out if this rule applies to the argument of a specified field
|
boolean |
appliesTo(graphql.schema.GraphQLFieldDefinition fieldDefinition,
graphql.schema.GraphQLFieldsContainer fieldsContainer)
This is called to work out if this rule applies to a specified field
|
java.util.List<graphql.GraphQLError> |
runValidation(ValidationEnvironment validationEnvironment)
This is called to runs the rule.
|
boolean appliesTo(graphql.schema.GraphQLFieldDefinition fieldDefinition,
graphql.schema.GraphQLFieldsContainer fieldsContainer)
fieldDefinition - the field to checkfieldsContainer - the field containerboolean appliesTo(graphql.schema.GraphQLArgument argument,
graphql.schema.GraphQLFieldDefinition fieldDefinition,
graphql.schema.GraphQLFieldsContainer fieldsContainer)
argument - the argument to checkfieldDefinition - the field to checkfieldsContainer - the field containerjava.util.List<graphql.GraphQLError> runValidation(ValidationEnvironment validationEnvironment)
GraphQLInputObjectType then it will be invoked for each attribute of that
type.
A rule should consult ValidationEnvironment.getValidatedElement() to check
what element is being validated. If the rule does not handle that type of element,
simply return an empty list of errors.
validationEnvironment - the validation environment