Last active
July 19, 2020 17:56
-
-
Save mtvspec/d9e1a83cb51446825b196b75a6b45671 to your computer and use it in GitHub Desktop.
GraphQL Mutation Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation createBook($data: BookInput!) { | |
createBook(data: $data) { | |
id | |
title | |
description | |
} | |
} | |
{ | |
"data": { | |
"title": "Book 4", | |
"author": 1 | |
} | |
} | |
mutation updateBook($id: ID! $data: BookInput!) { | |
updateBook(id: $id data: $data) { | |
id | |
title | |
description | |
} | |
} | |
{ | |
"id": 1, | |
"data": { | |
"title": "Book 1", | |
"description": "Book description", | |
"author": 1 | |
} | |
} | |
mutation deleteBook($id: ID!) { | |
deleteBook(id: $id) { | |
id | |
title | |
} | |
} | |
{ | |
"id": 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment