Skip to content

Commit

Permalink
Merge pull request #1255 from swalkinshaw/fix-printing-object-type-de…
Browse files Browse the repository at this point in the history
…finition-directives

Fix printing object type definitions
  • Loading branch information
Robert Mosolgo authored Feb 2, 2018
2 parents 401845b + c5993ca commit 29cb07e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/graphql/language/printer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/graphql/language/printer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 29cb07e

Please sign in to comment.