Class ArgValueOfAllowedTypeChecker

java.lang.Object
graphql.schema.idl.ArgValueOfAllowedTypeChecker

class ArgValueOfAllowedTypeChecker extends Object
Class to check whether a given directive argument value matches a given directive definition.
  • Field Details

    • logNotSafe

      private static final org.slf4j.Logger logNotSafe
    • directive

      private final Directive directive
    • element

      private final Node<?> element
    • elementName

      private final String elementName
    • argument

      private final Argument argument
    • typeRegistry

      private final TypeDefinitionRegistry typeRegistry
    • runtimeWiring

      private final RuntimeWiring runtimeWiring
  • Constructor Details

  • 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 collector
      instanceValue - directive argument value
      allowedArgType - directive definition argument allowed type
    • addValidationError

      private void addValidationError(List<GraphQLError> errors, String message, Object... args)
    • 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

      private boolean isArgumentValueScalarLiteral(GraphQLScalarType scalarType, Value<?> instanceValue)