File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ def print_schema
89
89
end
90
90
91
91
def print_type ( type )
92
- node = @document_from_schema . build_object_type_node ( type )
92
+ node = @document_from_schema . build_type_definition_node ( type )
93
93
print ( node )
94
94
end
95
95
Original file line number Diff line number Diff line change @@ -630,6 +630,20 @@ def foobar
630
630
assert_equal expected . chomp , GraphQL ::Schema ::Printer . new ( schema ) . print_type ( schema . types [ 'Post' ] )
631
631
end
632
632
633
+ it "can print non-object types" do
634
+ expected = <<SCHEMA
635
+ # Test
636
+ input Sub {
637
+ # Something
638
+ int: Int
639
+
640
+ # Something
641
+ string: String
642
+ }
643
+ SCHEMA
644
+ assert_equal expected . chomp , GraphQL ::Schema ::Printer . new ( schema ) . print_type ( schema . types [ 'Sub' ] )
645
+ end
646
+
633
647
it "can print arguments that use non-standard Ruby objects as default values" do
634
648
backing_object = Struct . new ( :value )
635
649
You can’t perform that action at this time.
0 commit comments