Package graphql.schema.idl
Class SchemaTypeDirectivesChecker
java.lang.Object
graphql.schema.idl.SchemaTypeDirectivesChecker
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
FieldsModifier and TypeFieldDescriptionprivate final RuntimeWiring
private final TypeDefinitionRegistry
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaTypeDirectivesChecker
(TypeDefinitionRegistry typeRegistry, RuntimeWiring runtimeWiring) -
Method Summary
Modifier and TypeMethodDescriptionvoid
assertExistAndIsInputType
(InputValueDefinition definition, List<GraphQLError> errors) private void
assertTypeName
(NamedNode node, List<GraphQLError> errors) private void
checkDirectiveArguments
(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node element, String elementName, Directive directive, DirectiveDefinition directiveDefinition) private void
checkDirectives
(Introspection.DirectiveLocation expectedLocation, List<GraphQLError> errors, TypeDefinition<?> typeDef) private void
checkDirectives
(Introspection.DirectiveLocation expectedLocation, List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node<?> element, String elementName, List<Directive> directives) private void
checkFieldsDirectives
(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, List<FieldDefinition> fieldDefinitions) (package private) void
checkTypeDirectives
(List<GraphQLError> errors) private void
commonCheck
(Collection<DirectiveDefinition> directiveDefinitions, List<GraphQLError> errors) private TypeDefinition
findTypeDefFromRegistry
(String typeName, TypeDefinitionRegistry typeRegistry) private boolean
inRightLocation
(Introspection.DirectiveLocation expectedLocation, DirectiveDefinition directiveDefinition) private boolean
isNoNullArgWithoutDefaultValue
(InputValueDefinition definitionArgument)
-
Field Details
-
typeRegistry
-
runtimeWiring
-
-
Constructor Details
-
SchemaTypeDirectivesChecker
public SchemaTypeDirectivesChecker(TypeDefinitionRegistry typeRegistry, RuntimeWiring runtimeWiring)
-
-
Method Details
-
checkTypeDirectives
-
checkDirectives
private void checkDirectives(Introspection.DirectiveLocation expectedLocation, List<GraphQLError> errors, TypeDefinition<?> typeDef) -
checkFieldsDirectives
private void checkFieldsDirectives(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, List<FieldDefinition> fieldDefinitions) -
checkDirectives
private void checkDirectives(Introspection.DirectiveLocation expectedLocation, List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node<?> element, String elementName, List<Directive> directives) -
inRightLocation
private boolean inRightLocation(Introspection.DirectiveLocation expectedLocation, DirectiveDefinition directiveDefinition) -
checkDirectiveArguments
private void checkDirectiveArguments(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node element, String elementName, Directive directive, DirectiveDefinition directiveDefinition) -
isNoNullArgWithoutDefaultValue
-
commonCheck
private void commonCheck(Collection<DirectiveDefinition> directiveDefinitions, List<GraphQLError> errors) -
assertTypeName
-
assertExistAndIsInputType
-
findTypeDefFromRegistry
private TypeDefinition findTypeDefFromRegistry(String typeName, TypeDefinitionRegistry typeRegistry)
-