Package graphql.schema.idl
Class SchemaTypeDirectivesChecker
- java.lang.Object
-
- graphql.schema.idl.SchemaTypeDirectivesChecker
-
class SchemaTypeDirectivesChecker extends java.lang.Object
This is responsible for traversing EVERY type and field in the registry and ensuring that any directives used follow the directive definition rules, for example field directives can be used on object types
-
-
Field Summary
Fields Modifier and Type Field Description private RuntimeWiring
runtimeWiring
private TypeDefinitionRegistry
typeRegistry
-
Constructor Summary
Constructors Constructor Description SchemaTypeDirectivesChecker(TypeDefinitionRegistry typeRegistry, RuntimeWiring runtimeWiring)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertExistAndIsInputType(InputValueDefinition definition, java.util.List<GraphQLError> errors)
private void
assertTypeName(NamedNode node, java.util.List<GraphQLError> errors)
private void
checkDirectiveArguments(java.util.List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node element, java.lang.String elementName, Directive directive, DirectiveDefinition directiveDefinition)
private void
checkDirectives(Introspection.DirectiveLocation expectedLocation, java.util.List<GraphQLError> errors, TypeDefinition<?> typeDef)
private void
checkDirectives(Introspection.DirectiveLocation expectedLocation, java.util.List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node<?> element, java.lang.String elementName, java.util.List<Directive> directives)
private void
checkFieldsDirectives(java.util.List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, java.util.List<FieldDefinition> fieldDefinitions)
(package private) void
checkTypeDirectives(java.util.List<GraphQLError> errors)
private void
commonCheck(java.util.Collection<DirectiveDefinition> directiveDefinitions, java.util.List<GraphQLError> errors)
private TypeDefinition
findTypeDefFromRegistry(java.lang.String typeName, TypeDefinitionRegistry typeRegistry)
private boolean
inRightLocation(Introspection.DirectiveLocation expectedLocation, DirectiveDefinition directiveDefinition)
private boolean
isNoNullArgWithoutDefaultValue(InputValueDefinition definitionArgument)
-
-
-
Field Detail
-
typeRegistry
private final TypeDefinitionRegistry typeRegistry
-
runtimeWiring
private final RuntimeWiring runtimeWiring
-
-
Constructor Detail
-
SchemaTypeDirectivesChecker
public SchemaTypeDirectivesChecker(TypeDefinitionRegistry typeRegistry, RuntimeWiring runtimeWiring)
-
-
Method Detail
-
checkTypeDirectives
void checkTypeDirectives(java.util.List<GraphQLError> errors)
-
checkDirectives
private void checkDirectives(Introspection.DirectiveLocation expectedLocation, java.util.List<GraphQLError> errors, TypeDefinition<?> typeDef)
-
checkFieldsDirectives
private void checkFieldsDirectives(java.util.List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, java.util.List<FieldDefinition> fieldDefinitions)
-
checkDirectives
private void checkDirectives(Introspection.DirectiveLocation expectedLocation, java.util.List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node<?> element, java.lang.String elementName, java.util.List<Directive> directives)
-
inRightLocation
private boolean inRightLocation(Introspection.DirectiveLocation expectedLocation, DirectiveDefinition directiveDefinition)
-
checkDirectiveArguments
private void checkDirectiveArguments(java.util.List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node element, java.lang.String elementName, Directive directive, DirectiveDefinition directiveDefinition)
-
isNoNullArgWithoutDefaultValue
private boolean isNoNullArgWithoutDefaultValue(InputValueDefinition definitionArgument)
-
commonCheck
private void commonCheck(java.util.Collection<DirectiveDefinition> directiveDefinitions, java.util.List<GraphQLError> errors)
-
assertTypeName
private void assertTypeName(NamedNode node, java.util.List<GraphQLError> errors)
-
assertExistAndIsInputType
public void assertExistAndIsInputType(InputValueDefinition definition, java.util.List<GraphQLError> errors)
-
findTypeDefFromRegistry
private TypeDefinition findTypeDefFromRegistry(java.lang.String typeName, TypeDefinitionRegistry typeRegistry)
-
-