Skip to content

Commit f437dd9

Browse files
committed
Fix input object printing
1 parent 176832e commit f437dd9

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/graphql/language/nodes.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,6 @@ def serialize_value_for_hash(value)
296296
serialize_value_for_hash v
297297
end
298298
when Enum
299-
# TODO: this is required for _loading_ default values for input objects,
300-
# but it breaks printing those values!
301299
value.name
302300
when NullValue
303301
nil

lib/graphql/language/printer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def print_inline_fragment(inline_fragment, indent: "")
9393
end
9494

9595
def print_input_object(input_object)
96-
print_node(input_object.to_h)
96+
"{#{input_object.arguments.map { |a| "#{a.name}: #{print(a.value)}" }.join(", ")}}"
9797
end
9898

9999
def print_list_type(list_type)

0 commit comments

Comments
 (0)