Created
December 3, 2018 04:36
-
-
Save meshboy/6420ad1c890dfc7094e3f3ffda5277e2 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"; | |
// user object pointing to loginUser to make the return response pretty | |
export const LOGIN_QUERY = gql` | |
mutation LoginUser($input: LoginUser!) { | |
user: loginUser(input: $input) { | |
token | |
} | |
} | |
`; | |
export const REGISTERATION_QUERY = gql` | |
mutation RegisterUser($input: NewUser!) { | |
user: createUser(input: $input) { | |
token | |
} | |
} | |
`; | |
export const ALL_RECIPES_QUERY = gql` | |
query { | |
recipeList: Recipes { | |
id | |
name | |
image | |
} | |
} | |
`; | |
export const GET_USER_QUERY = gql` | |
query { | |
user: getMe { | |
name | |
recipes { | |
id | |
name | |
image | |
} | |
} | |
} | |
`; | |
export const CREATE_RECIPE_QUERY = gql` | |
mutation createRecipe($input: NewRecipe!) { | |
newRecipe(input: $input) { | |
id | |
} | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment