Skip to content

Instantly share code, notes, and snippets.

@malgamves

malgamves/graphql.js

Last active May 5, 2019
Embed
What would you like to do?
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
You can’t perform that action at this time.