Open jjackson0228 opened 3 days ago
Use data for mutations that coincide with the models. When we get more going we can update these issues to be more informative. HERE IS AN EXAMPLE: import { gql } from '@apollo/client';
export const LOGIN_USER = gql mutation login($email: String!, $password: String!) { login(email: $email, password: $password) { token user { _id username } } } ;
mutation login($email: String!, $password: String!) { login(email: $email, password: $password) { token user { _id username } } }
export const ADD_USER = gql mutation addUser($username: String!, $email: String!, $password: String!) { addUser(username: $username, email: $email, password: $password) { token user { _id username } } } ;
mutation addUser($username: String!, $email: String!, $password: String!) { addUser(username: $username, email: $email, password: $password) { token user { _id username } } }
export const ADD_THOUGHT = gql mutation addThought($thoughtText: String!) { addThought(thoughtText: $thoughtText) { _id thoughtText thoughtAuthor createdAt comments { _id commentText } } } ;
mutation addThought($thoughtText: String!) { addThought(thoughtText: $thoughtText) { _id thoughtText thoughtAuthor createdAt comments { _id commentText } } }
export const ADD_COMMENT = gql mutation addComment($thoughtId: ID!, $commentText: String!) { addComment(thoughtId: $thoughtId, commentText: $commentText) { _id thoughtText thoughtAuthor createdAt comments { _id commentText createdAt } } } ;
mutation addComment($thoughtId: ID!, $commentText: String!) { addComment(thoughtId: $thoughtId, commentText: $commentText) { _id thoughtText thoughtAuthor createdAt comments { _id commentText createdAt } } }
ADD_USER, LOGIN_USER, ADD_PET, ADD_COMMENT
Use data for mutations that coincide with the models. When we get more going we can update these issues to be more informative. HERE IS AN EXAMPLE: import { gql } from '@apollo/client';
export const LOGIN_USER = gql
mutation login($email: String!, $password: String!) { login(email: $email, password: $password) { token user { _id username } } }
;export const ADD_USER = gql
mutation addUser($username: String!, $email: String!, $password: String!) { addUser(username: $username, email: $email, password: $password) { token user { _id username } } }
;export const ADD_THOUGHT = gql
mutation addThought($thoughtText: String!) { addThought(thoughtText: $thoughtText) { _id thoughtText thoughtAuthor createdAt comments { _id commentText } } }
;export const ADD_COMMENT = gql
mutation addComment($thoughtId: ID!, $commentText: String!) { addComment(thoughtId: $thoughtId, commentText: $commentText) { _id thoughtText thoughtAuthor createdAt comments { _id commentText createdAt } } }
;