Package graphql.schema.idl
Class SchemaTypeDirectivesChecker
- java.lang.Object
-
- graphql.schema.idl.SchemaTypeDirectivesChecker
-
class SchemaTypeDirectivesChecker extends java.lang.ObjectThis 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 RuntimeWiringruntimeWiringprivate TypeDefinitionRegistrytypeRegistry
-
Constructor Summary
Constructors Constructor Description SchemaTypeDirectivesChecker(TypeDefinitionRegistry typeRegistry, RuntimeWiring runtimeWiring)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertExistAndIsInputType(InputValueDefinition definition, java.util.List<GraphQLError> errors)private voidassertTypeName(NamedNode node, java.util.List<GraphQLError> errors)private voidcheckDirectiveArguments(java.util.List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node element, java.lang.String elementName, Directive directive, DirectiveDefinition directiveDefinition)private voidcheckDirectives(Introspection.DirectiveLocation expectedLocation, java.util.List<GraphQLError> errors, TypeDefinition<?> typeDef)private voidcheckDirectives(Introspection.DirectiveLocation expectedLocation, java.util.List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node<?> element, java.lang.String elementName, java.util.List<Directive> directives)private voidcheckFieldsDirectives(java.util.List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, java.util.List<FieldDefinition> fieldDefinitions)(package private) voidcheckTypeDirectives(java.util.List<GraphQLError> errors)private voidcommonCheck(java.util.Collection<DirectiveDefinition> directiveDefinitions, java.util.List<GraphQLError> errors)private TypeDefinitionfindTypeDefFromRegistry(java.lang.String typeName, TypeDefinitionRegistry typeRegistry)private booleaninRightLocation(Introspection.DirectiveLocation expectedLocation, DirectiveDefinition directiveDefinition)private booleanisNoNullArgWithoutDefaultValue(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)
-
-