Package graphql.schema.validation
Class TypeAndFieldRule
- java.lang.Object
-
- graphql.schema.GraphQLTypeVisitorStub
-
- graphql.schema.validation.TypeAndFieldRule
-
- All Implemented Interfaces:
GraphQLTypeVisitor
public class TypeAndFieldRule extends GraphQLTypeVisitorStub
The validation about GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLScalarType.- Types must define one or more fields;
- Enum type must define one or more enum values;
- Union type must include one or more unique member types;
- The member types of a Union type must all be Object base types;
- Non‐Null type must not wrap another Non‐Null type;
- Invalid name begin with "__" (two underscores).
details in https://spec.graphql.org/June2018/#sec-Type-System
-
-
Constructor Summary
Constructors Constructor Description TypeAndFieldRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TraversalControl
visitGraphQLEnumType(GraphQLEnumType type, TraverserContext<GraphQLSchemaElement> context)
TraversalControl
visitGraphQLInputObjectType(GraphQLInputObjectType type, TraverserContext<GraphQLSchemaElement> context)
TraversalControl
visitGraphQLInterfaceType(GraphQLInterfaceType type, TraverserContext<GraphQLSchemaElement> context)
TraversalControl
visitGraphQLObjectType(GraphQLObjectType type, TraverserContext<GraphQLSchemaElement> context)
TraversalControl
visitGraphQLUnionType(GraphQLUnionType type, TraverserContext<GraphQLSchemaElement> context)
-
Methods inherited from class graphql.schema.GraphQLTypeVisitorStub
visitGraphQLAppliedDirective, visitGraphQLAppliedDirectiveArgument, visitGraphQLArgument, visitGraphQLDirective, visitGraphQLEnumValueDefinition, visitGraphQLFieldDefinition, visitGraphQLInputObjectField, visitGraphQLList, visitGraphQLNonNull, visitGraphQLScalarType, visitGraphQLType, visitGraphQLTypeReference
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface graphql.schema.GraphQLTypeVisitor
changeNode, deleteNode, insertAfter, insertBefore, visitBackRef, visitGraphQLCompositeType, visitGraphQLDirectiveContainer, visitGraphQLFieldsContainer, visitGraphQLInputFieldsContainer, visitGraphQLInputType, visitGraphQLModifiedType, visitGraphQLNullableType, visitGraphQLOutputType, visitGraphQLUnmodifiedType
-
-
-
-
Method Detail
-
visitGraphQLInterfaceType
public TraversalControl visitGraphQLInterfaceType(GraphQLInterfaceType type, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLInterfaceType
in interfaceGraphQLTypeVisitor
- Overrides:
visitGraphQLInterfaceType
in classGraphQLTypeVisitorStub
-
visitGraphQLObjectType
public TraversalControl visitGraphQLObjectType(GraphQLObjectType type, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLObjectType
in interfaceGraphQLTypeVisitor
- Overrides:
visitGraphQLObjectType
in classGraphQLTypeVisitorStub
-
visitGraphQLUnionType
public TraversalControl visitGraphQLUnionType(GraphQLUnionType type, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLUnionType
in interfaceGraphQLTypeVisitor
- Overrides:
visitGraphQLUnionType
in classGraphQLTypeVisitorStub
-
visitGraphQLEnumType
public TraversalControl visitGraphQLEnumType(GraphQLEnumType type, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLEnumType
in interfaceGraphQLTypeVisitor
- Overrides:
visitGraphQLEnumType
in classGraphQLTypeVisitorStub
-
visitGraphQLInputObjectType
public TraversalControl visitGraphQLInputObjectType(GraphQLInputObjectType type, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLInputObjectType
in interfaceGraphQLTypeVisitor
- Overrides:
visitGraphQLInputObjectType
in classGraphQLTypeVisitorStub
-
-