Created
October 26, 2018 14:23
-
-
Save malgamves/1065e20e8c5b3fe89196a29c307bf60c to your computer and use it in GitHub Desktop.
File containing GraphQL operations
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 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