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 RuntimeWiringprivate final TypeDefinitionRegistry -
Constructor Summary
ConstructorsConstructorDescriptionSchemaTypeDirectivesChecker(TypeDefinitionRegistry typeRegistry, RuntimeWiring runtimeWiring) -
Method Summary
Modifier and TypeMethodDescriptionvoidassertExistAndIsInputType(InputValueDefinition definition, List<GraphQLError> errors) private voidassertTypeName(NamedNode node, List<GraphQLError> errors) private voidcheckDirectiveArguments(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node element, String elementName, Directive directive, DirectiveDefinition directiveDefinition) private voidcheckDirectives(Introspection.DirectiveLocation expectedLocation, List<GraphQLError> errors, TypeDefinition<?> typeDef) private voidcheckDirectives(Introspection.DirectiveLocation expectedLocation, List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, Node<?> element, String elementName, List<Directive> directives) private voidcheckFieldsDirectives(List<GraphQLError> errors, TypeDefinitionRegistry typeRegistry, List<FieldDefinition> fieldDefinitions) (package private) voidcheckTypeDirectives(List<GraphQLError> errors) private voidcommonCheck(Collection<DirectiveDefinition> directiveDefinitions, List<GraphQLError> errors) private TypeDefinitionfindTypeDefFromRegistry(String typeName, TypeDefinitionRegistry typeRegistry) private booleaninRightLocation(Introspection.DirectiveLocation expectedLocation, DirectiveDefinition directiveDefinition) private booleanisNoNullArgWithoutDefaultValue(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)
-