File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ def print_object_type_definition(object_type)
170170 end
171171
172172 def print_implements ( type )
173- " implements #{ type . interfaces . map ( &:name ) . join ( " & " ) } "
173+ " implements #{ type . interfaces . map ( &:name ) . uniq . join ( " & " ) } "
174174 end
175175
176176 def print_input_value_definition ( input_value )
Original file line number Diff line number Diff line change @@ -556,6 +556,36 @@ def assert_schema_and_compare_output(definition)
556556 assert_schema_and_compare_output ( schema )
557557 end
558558
559+ it "only adds the interface to the type once" do
560+ schema = <<-SCHEMA
561+ interface Named implements Node {
562+ id: ID
563+ name: String
564+ }
565+
566+ interface Node {
567+ id: ID
568+ }
569+
570+ type Query {
571+ thing: Thing
572+ }
573+
574+ type Thing implements Named & Node & Timestamped {
575+ id: ID
576+ name: String
577+ timestamp: String
578+ }
579+
580+ interface Timestamped implements Node {
581+ id: ID
582+ timestamp: String
583+ }
584+ SCHEMA
585+
586+ assert_schema_and_compare_output ( schema )
587+ end
588+
559589 it 'supports simple output enum' do
560590 schema = <<-SCHEMA
561591schema {
You can’t perform that action at this time.
0 commit comments