Skip to content

Instantly share code, notes, and snippets.

@meshboy
Created December 3, 2018 04:36
Show Gist options
  • Save meshboy/6420ad1c890dfc7094e3f3ffda5277e2 to your computer and use it in GitHub Desktop.
Save meshboy/6420ad1c890dfc7094e3f3ffda5277e2 to your computer and use it in GitHub Desktop.
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
email
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