doc/md: simplify graphql mutation usage (#2464)

This commit is contained in:
dorlib
2022-04-09 20:59:55 +03:00
committed by GitHub
parent 6e4e4da896
commit 3683de1d36
2 changed files with 4 additions and 6 deletions

View File

@@ -331,8 +331,8 @@ func (r *mutationResolver) CreateTodo(ctx context.Context, todo TodoInput) (*ent
Now, creating a todo item should work:
```graphql
mutation CreateTodo($todo: TodoInput!) {
createTodo(todo: $todo) {
mutation CreateTodo {
createTodo(todo: {text: "Create GraphQL Example", status: IN_PROGRESS, priority: 1}) {
id
text
createdAt
@@ -342,8 +342,6 @@ mutation CreateTodo($todo: TodoInput!) {
}
}
}
# Query Variables: { "todo": { "text": "Create GraphQL Example", "status": "IN_PROGRESS", "priority": 1 } }
# Output: { "data": { "createTodo": { "id": "2", "text": "Create GraphQL Example", "createdAt": "2021-03-10T15:02:18+02:00", "priority": 1, "parent": null } } }
```