Skip to content

Commit

Permalink
Merge pull request #31 from rigglo/docs
Browse files Browse the repository at this point in the history
fix sdl
  • Loading branch information
Fontinalis authored Jul 5, 2021
2 parents 56f7039 + f73cad8 commit b360fe7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 5 additions & 2 deletions examples/movies/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ var (
BlockBusters = &gql.Schema{
Query: Query,
Mutation: nil,
AdditionalTypes: []gql.Type{
FooInput,
},
}

FooInput = &gql.InputObject{
Expand All @@ -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",
},
Expand Down
9 changes: 8 additions & 1 deletion pkg/language/ast/typesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit b360fe7

Please sign in to comment.