Package graphql.schema.idl
Class ArgValueOfAllowedTypeChecker
java.lang.Object
graphql.schema.idl.ArgValueOfAllowedTypeChecker
Class to check whether a given directive argument value
matches a given directive definition.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Argumentprivate final Directiveprivate final Node<?> private final Stringprivate static final org.slf4j.Loggerprivate final RuntimeWiringprivate final TypeDefinitionRegistry -
Constructor Summary
ConstructorsConstructorDescriptionArgValueOfAllowedTypeChecker(Directive directive, Node<?> element, String elementName, Argument argument, TypeDefinitionRegistry typeRegistry, RuntimeWiring runtimeWiring) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddValidationError(List<GraphQLError> errors, String message, Object... args) private voidcheckArgInputObjectValueFieldMatchesAllowedDefinition(List<GraphQLError> errors, ObjectField objectField, InputValueDefinition allowedValueDef) private voidcheckArgValueMatchesAllowedEnum(List<GraphQLError> errors, Value<?> instanceValue, EnumTypeDefinition allowedTypeDefinition) private voidcheckArgValueMatchesAllowedInputType(List<GraphQLError> errors, Value<?> instanceValue, InputObjectTypeDefinition allowedTypeDefinition) private voidcheckArgValueMatchesAllowedListType(List<GraphQLError> errors, Value<?> instanceValue, ListType allowedArgType) private voidcheckArgValueMatchesAllowedNonNullType(List<GraphQLError> errors, Value<?> instanceValue, NonNullType allowedArgType) private voidcheckArgValueMatchesAllowedScalar(List<GraphQLError> errors, Value<?> instanceValue, ScalarTypeDefinition allowedTypeDefinition) (package private) voidcheckArgValueMatchesAllowedType(List<GraphQLError> errors, Value<?> instanceValue, Type<?> allowedArgType) Recursively inspects an argument value given an allowed type.private voidcheckArgValueMatchesAllowedTypeName(List<GraphQLError> errors, Value<?> instanceValue, Type<?> allowedArgType) private booleanisArgumentValueScalarLiteral(GraphQLScalarType scalarType, Value<?> instanceValue)
-
Field Details
-
logNotSafe
private static final org.slf4j.Logger logNotSafe -
directive
-
element
-
elementName
-
argument
-
typeRegistry
-
runtimeWiring
-
-
Constructor Details
-
ArgValueOfAllowedTypeChecker
ArgValueOfAllowedTypeChecker(Directive directive, Node<?> element, String elementName, Argument argument, TypeDefinitionRegistry typeRegistry, RuntimeWiring runtimeWiring)
-
-
Method Details
-
checkArgValueMatchesAllowedType
void checkArgValueMatchesAllowedType(List<GraphQLError> errors, Value<?> instanceValue, Type<?> allowedArgType) Recursively inspects an argument value given an allowed type. Given the (invalid) SDL below:directive @myDirective(arg: [[String]] ) on FIELD_DEFINITION
query { f: String @myDirective(arg: ["A String"]) }
it will first check that the `myDirective.arg` type is an array and fail when finding "A String" as it expected a nested array ([[String]]).
- Parameters:
errors- validation error collectorinstanceValue- directive argument valueallowedArgType- directive definition argument allowed type
-
addValidationError
-
checkArgValueMatchesAllowedTypeName
private void checkArgValueMatchesAllowedTypeName(List<GraphQLError> errors, Value<?> instanceValue, Type<?> allowedArgType) -
checkArgValueMatchesAllowedInputType
private void checkArgValueMatchesAllowedInputType(List<GraphQLError> errors, Value<?> instanceValue, InputObjectTypeDefinition allowedTypeDefinition) -
checkArgValueMatchesAllowedEnum
private void checkArgValueMatchesAllowedEnum(List<GraphQLError> errors, Value<?> instanceValue, EnumTypeDefinition allowedTypeDefinition) -
checkArgValueMatchesAllowedScalar
private void checkArgValueMatchesAllowedScalar(List<GraphQLError> errors, Value<?> instanceValue, ScalarTypeDefinition allowedTypeDefinition) -
checkArgInputObjectValueFieldMatchesAllowedDefinition
private void checkArgInputObjectValueFieldMatchesAllowedDefinition(List<GraphQLError> errors, ObjectField objectField, InputValueDefinition allowedValueDef) -
checkArgValueMatchesAllowedNonNullType
private void checkArgValueMatchesAllowedNonNullType(List<GraphQLError> errors, Value<?> instanceValue, NonNullType allowedArgType) -
checkArgValueMatchesAllowedListType
private void checkArgValueMatchesAllowedListType(List<GraphQLError> errors, Value<?> instanceValue, ListType allowedArgType) -
isArgumentValueScalarLiteral
-