Skip to content

Commit

Permalink
Merge pull request #1417 from RicCu/patch-1
Browse files Browse the repository at this point in the history
Use mutation instead of query in 'Changesets' doc example
  • Loading branch information
mtibben authored Jul 29, 2021
2 parents e3293b5 + 918801e commit 0119743
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/content/reference/changesets.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Occasionally you need to distinguish presence from nil (undefined vs null). In g


```graphql
type Query {
type Mutation {
updateUser(id: ID!, changes: UserChanges!): User
}

Expand All @@ -28,7 +28,7 @@ models:

After running go generate you should end up with a resolver that looks like this:
```go
func (r *queryResolver) UpdateUser(ctx context.Context, id int, changes map[string]interface{}) (*User, error) {
func (r *mutationResolver) UpdateUser(ctx context.Context, id int, changes map[string]interface{}) (*User, error) {
u := fetchFromDb(id)
/// apply the changes
saveToDb(u)
Expand Down

0 comments on commit 0119743

Please sign in to comment.