Method: GraphQL::Language::SanitizedPrinter#print_node

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


39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/graphql/language/sanitized_printer.rb', line 39

def print_node(node, indent: "")
  case node
  when FalseClass, Float, Integer, String, TrueClass
    if @current_argument && redact_argument_value?(@current_argument, node)
      print_string(redacted_argument_value(@current_argument))
    else
      super
    end
  when Array
    old_input_type = @current_input_type
    if @current_input_type && @current_input_type.list?
      @current_input_type = @current_input_type.of_type
      @current_input_type = @current_input_type.of_type if @current_input_type.non_null?
    end

    super
    @current_input_type = old_input_type
  else
    super
  end
end