diff --git a/lib/graphql/language/printer.rb b/lib/graphql/language/printer.rb index 3601cb5338..ec98542a36 100644 --- a/lib/graphql/language/printer.rb +++ b/lib/graphql/language/printer.rb @@ -154,8 +154,8 @@ def print_scalar_type_definition(scalar_type) def print_object_type_definition(object_type) out = print_description(object_type) out << "type #{object_type.name}" - out << print_directives(object_type.directives) out << " implements " << object_type.interfaces.map(&:name).join(", ") unless object_type.interfaces.empty? + out << print_directives(object_type.directives) out << print_field_definitions(object_type.fields) end diff --git a/spec/graphql/language/printer_spec.rb b/spec/graphql/language/printer_spec.rb index 3f457e41b1..3fe5a29b92 100644 --- a/spec/graphql/language/printer_spec.rb +++ b/spec/graphql/language/printer_spec.rb @@ -105,7 +105,7 @@ end describe "full featured schema" do - # From: https://github.com/graphql/graphql-js/blob/bc96406ab44453a120da25a0bd6e2b0237119ddf/src/language/__tests__/schema-kitchen-sink.graphql + # Based on: https://github.com/graphql/graphql-js/blob/bc96406ab44453a120da25a0bd6e2b0237119ddf/src/language/__tests__/schema-kitchen-sink.graphql let(:query_string) {<<-schema schema { query: QueryType @@ -128,7 +128,7 @@ # Scalar description scalar CustomScalar - type AnnotatedObject @onObject(arg: "value") { + type AnnotatedObject implements Bar @onObject(arg: "value") { annotatedField(arg: Type = "default" @onArg): Type @onField }