Last active
May 5, 2019 10:34
-
-
Save malgamves/eaac3553d7dec9b598e5b180a4798c3e to your computer and use it in GitHub Desktop.
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
import gql from 'graphql-tag' | |
export const ADD_VOTE_MUTATION = gql` | |
mutation updateVotes($id: Int!) { | |
update_characters(where: {id: {_eq: $id}}, | |
_inc: {votes: 1}) { | |
affected_rows | |
} | |
} | |
`; | |
export const ALL_CHAR_QUERY = gql` | |
query characters { | |
characters(order_by: {id: asc}) { | |
id | |
name | |
} | |
} | |
`; | |
export const ALL_VOTES_SUBSCRIPTION = gql` | |
subscription allVotes{ | |
CharacterDeathVotes : characters(order_by: {id: asc}) { | |
label: name | |
data: votes | |
} | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment