Skip to content

Instantly share code, notes, and snippets.

@malgamves
Created October 26, 2018 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malgamves/1065e20e8c5b3fe89196a29c307bf60c to your computer and use it in GitHub Desktop.
Save malgamves/1065e20e8c5b3fe89196a29c307bf60c to your computer and use it in GitHub Desktop.
File containing GraphQL operations
import gql from 'graphql-tag'
export const ALL_BOOKS_QUERY = gql`
query books {
books {
id
author
name
}
}
`;
export const ADD_BOOK_MUTATION = gql`
mutation addBook($author: String!, $name: String!){
insert_books(objects: [{name: $name, author: $author}]) {
affected_rows
}
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment