Skip to content

Instantly share code, notes, and snippets.

@maticzav
Created January 3, 2018 21:17
Show Gist options
  • Save maticzav/922c3285dee4752065e258eabf5d32b0 to your computer and use it in GitHub Desktop.
Save maticzav/922c3285dee4752065e258eabf5d32b0 to your computer and use it in GitHub Desktop.
# To Authenticate
mutation Authenticate($githubCode: String!) {
authenticate(githubCode: $githubCode) {
token
user {
name
}
}
}
# To create a Note
mutation NewNote($text: String!) {
createNote(text: $text) {
id
text
}
}
# To edit a Note
mutation ChangeNote($id: ID!, $newText: String!) {
updateNote(id: $id, text: $newText) {
id
text
}
}
# To delete a Note
mutation DeleteNote($id: ID!) {
deleteNote(id: $id) {
id
}
}
# To get your profile and your notes
mutation Me {
me {
name
bio
notes {
id
text
}
}
}
@hackdie
Copy link

hackdie commented Mar 2, 2018

Should be Query instead of mutation

mutation Me { me { name bio notes { id text } } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment