diff --git a/examples/movies/main.go b/examples/movies/main.go index 2707767..cb0377c 100644 --- a/examples/movies/main.go +++ b/examples/movies/main.go @@ -29,6 +29,9 @@ var ( BlockBusters = &gql.Schema{ Query: Query, Mutation: nil, + AdditionalTypes: []gql.Type{ + FooInput, + }, } FooInput = &gql.InputObject{ @@ -50,11 +53,11 @@ var ( Description: "", Resolver: func(ctx gql.Context) (interface{}, error) { return []Movie{ - Movie{ + { ID: "22424234", Title: "Interstellar", }, - Movie{ + { ID: "34363453", Title: "Titanic", }, diff --git a/pkg/language/ast/typesystem.go b/pkg/language/ast/typesystem.go index 979b976..85c9b71 100644 --- a/pkg/language/ast/typesystem.go +++ b/pkg/language/ast/typesystem.go @@ -263,7 +263,14 @@ func (d *InputObjectDefinition) String() string { for _, dir := range d.Directives { out += dir.String() + " " } - out += "{\n}\n" + out += "{\n" + for i, f := range d.Fields { + if i != 0 { + out += "\n" + } + out += "\t" + f.String() + } + out += "\n}\n" return out }