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 TraversalControlvisitGraphQLEnumType(GraphQLEnumType type, TraverserContext<GraphQLSchemaElement> context)TraversalControlvisitGraphQLInputObjectType(GraphQLInputObjectType type, TraverserContext<GraphQLSchemaElement> context)TraversalControlvisitGraphQLInterfaceType(GraphQLInterfaceType type, TraverserContext<GraphQLSchemaElement> context)TraversalControlvisitGraphQLObjectType(GraphQLObjectType type, TraverserContext<GraphQLSchemaElement> context)TraversalControlvisitGraphQLUnionType(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:
visitGraphQLInterfaceTypein interfaceGraphQLTypeVisitor- Overrides:
visitGraphQLInterfaceTypein classGraphQLTypeVisitorStub
-
visitGraphQLObjectType
public TraversalControl visitGraphQLObjectType(GraphQLObjectType type, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLObjectTypein interfaceGraphQLTypeVisitor- Overrides:
visitGraphQLObjectTypein classGraphQLTypeVisitorStub
-
visitGraphQLUnionType
public TraversalControl visitGraphQLUnionType(GraphQLUnionType type, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLUnionTypein interfaceGraphQLTypeVisitor- Overrides:
visitGraphQLUnionTypein classGraphQLTypeVisitorStub
-
visitGraphQLEnumType
public TraversalControl visitGraphQLEnumType(GraphQLEnumType type, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLEnumTypein interfaceGraphQLTypeVisitor- Overrides:
visitGraphQLEnumTypein classGraphQLTypeVisitorStub
-
visitGraphQLInputObjectType
public TraversalControl visitGraphQLInputObjectType(GraphQLInputObjectType type, TraverserContext<GraphQLSchemaElement> context)
- Specified by:
visitGraphQLInputObjectTypein interfaceGraphQLTypeVisitor- Overrides:
visitGraphQLInputObjectTypein classGraphQLTypeVisitorStub
-
-