Skip to content

Commit a614736

Browse files
committed
wrap mutation arguments with graphql.NewNonNull
1 parent d4bebe8 commit a614736

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/server/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,20 @@ func main() {
6969
Type: documentType,
7070
Args: graphql.FieldConfigArgument{
7171
"id": &graphql.ArgumentConfig{
72-
Type: graphql.Int,
72+
Type: graphql.NewNonNull(graphql.Int),
7373
},
7474
"title": &graphql.ArgumentConfig{
75-
Type: graphql.String,
75+
Type: graphql.NewNonNull(graphql.String),
7676
},
7777
"content": &graphql.ArgumentConfig{
78-
Type: graphql.String,
78+
Type: graphql.NewNonNull(graphql.String),
7979
},
8080
},
8181
Resolve: func(p graphql.ResolveParams) (interface{}, error) {
8282

8383
id := p.Args["id"].(int)
8484
documents[id].Title = p.Args["title"].(string)
85-
documents[id].Title = p.Args["title"].(string)
85+
documents[id].Content = p.Args["content"].(string)
8686

8787
for _, subscriptions := range subscriptionManager.Subscriptions() {
8888
for _, subscription := range subscriptions {

0 commit comments

Comments
 (0)