Interface ValueVisitor


@PublicSpi public interface ValueVisitor
A visitor callback used by ValueTraverser
  • Field Details

    • ABSENCE_SENTINEL

      static final Object ABSENCE_SENTINEL
      This magic sentinel value indicates that a value should be removed from a list or object versus being set to null, that is the difference between a value not being present and a value being null
  • Method Details

    • visitScalarValue

      default @Nullable Object visitScalarValue(@Nullable Object coercedValue, GraphQLScalarType inputType, ValueVisitor.InputElements inputElements)
      This is called when a scalar value is encountered
      Parameters:
      coercedValue - the value that is in coerced form
      inputType - the type of scalar
      inputElements - the elements that lead to this value and type
      Returns:
      the same value or a new value
    • visitEnumValue

      default @Nullable Object visitEnumValue(@Nullable Object coercedValue, GraphQLEnumType inputType, ValueVisitor.InputElements inputElements)
      This is called when an enum value is encountered
      Parameters:
      coercedValue - the value that is in coerced form
      inputType - the type of enum
      inputElements - the elements that lead to this value and type
      Returns:
      the same value or a new value
    • visitInputObjectFieldValue

      default @Nullable Object visitInputObjectFieldValue(@Nullable Object coercedValue, GraphQLInputObjectType inputObjectType, GraphQLInputObjectField inputObjectField, ValueVisitor.InputElements inputElements)
      This is called when an input object field value is encountered
      Parameters:
      coercedValue - the value that is in coerced form
      inputObjectType - the input object type containing the input field
      inputObjectField - the input object field
      inputElements - the elements that lead to this value and type
      Returns:
      the same value or a new value
    • visitInputObjectValue

      default @Nullable Map<String,Object> visitInputObjectValue(@Nullable Map<String,Object> coercedValue, GraphQLInputObjectType inputObjectType, ValueVisitor.InputElements inputElements)
      This is called when an input object value is encountered.
      Parameters:
      coercedValue - the value that is in coerced form
      inputObjectType - the input object type
      inputElements - the elements that lead to this value and type
      Returns:
      the same value or a new value
    • visitListValue

      default @Nullable List<Object> visitListValue(@Nullable List<Object> coercedValue, GraphQLList listInputType, ValueVisitor.InputElements inputElements)
      This is called when an input list value is encountered.
      Parameters:
      coercedValue - the value that is in coerced form
      listInputType - the input list type
      inputElements - the elements that lead to this value and type
      Returns:
      the same value or a new value
    • visitArgumentValue

      default @Nullable Object visitArgumentValue(@Nullable Object coercedValue, GraphQLArgument graphQLArgument, ValueVisitor.InputElements inputElements)
      This is called when a GraphQLArgument is encountered
      Parameters:
      coercedValue - the value that is in coerced form
      graphQLArgument - the GraphQLArgument in play
      inputElements - the elements that lead to this value and type
      Returns:
      the same value or a new value
    • visitAppliedDirectiveArgumentValue

      default @Nullable Object visitAppliedDirectiveArgumentValue(@Nullable Object coercedValue, GraphQLAppliedDirectiveArgument graphQLAppliedDirectiveArgument, ValueVisitor.InputElements inputElements)
      This is called when a GraphQLAppliedDirectiveArgument is encountered
      Parameters:
      coercedValue - the value that is in coerced form
      graphQLAppliedDirectiveArgument - the GraphQLAppliedDirectiveArgument in play
      inputElements - the elements that lead to this value and type
      Returns:
      the same value or a new value