Method: GraphQL::Language::SanitizedPrinter#redact_argument_value?

Defined in:
lib/graphql/language/sanitized_printer.rb

#redact_argument_value?(argument, value) ⇒ Boolean

Indicates whether or not to redact non-null values for the given argument. Defaults to redacting all strings arguments but this can be customized by subclasses.

Returns:

  • (Boolean)


63
64
65
66
67
# File 'lib/graphql/language/sanitized_printer.rb', line 63

def redact_argument_value?(argument, value)
  # Default to redacting any strings or custom scalars encoded as strings
  type = argument.type.unwrap
  value.is_a?(String) && type.kind.scalar? && (type.graphql_name == "String" || !type.default_scalar?)
end