summaryrefslogtreecommitdiffstats
path: root/frontend/queries/index.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-02-09 13:31:39 -0500
committerWes Bos <wesbos@gmail.com>2018-02-09 13:31:39 -0500
commite0d0baa75ec0bf617f91b6cd779305d4009cae12 (patch)
tree00eb968f49c6586cbc4367053887d0c5e68471b2 /frontend/queries/index.js
parent19c9683e2126c68cb9d231293162c756d69c51fb (diff)
🆒
Diffstat (limited to 'frontend/queries/index.js')
-rw-r--r--frontend/queries/index.js41
1 files changed, 27 insertions, 14 deletions
diff --git a/frontend/queries/index.js b/frontend/queries/index.js
index ea02c8b..e61a9d5 100644
--- a/frontend/queries/index.js
+++ b/frontend/queries/index.js
@@ -44,6 +44,19 @@ export const REQUEST_RESET_MUTATION = gql`
}
`;
+export const RESET_MUTATION = gql`
+ mutation resetPassword($resetToken: String!, $password: String!, $confirmPassword: String!) {
+ resetPassword(resetToken: $resetToken, password: $password, confirmPassword: $confirmPassword) {
+ token
+ user {
+ id
+ email
+ name
+ }
+ }
+ }
+`;
+
export const CREATE_ORDER_MUTATION = gql`
mutation CreateOrderMutation($token: String!, $userId: ID!, $itemId: ID!) {
createOrder(token: $token, userId: $userId, itemId: $itemId) {
@@ -142,11 +155,19 @@ export const UPDATE_LINK_MUTATION = gql`
`;
export const CURRENT_USER_QUERY = gql`
+ ${itemDetails}
query userQuery {
me {
id
email
name
+ cart {
+ id
+ quantity
+ item {
+ ...itemDetails
+ }
+ }
}
}
`;
@@ -176,25 +197,17 @@ export const USER_ORDERS_QUERY = gql`
`;
export const ADD_TO_CART_MUTATION = gql`
- mutation AddToCart($userId: ID!, $itemId: ID!) {
- addToCartItems(userUserId: $userId, cartItemId: $itemId) {
- cartItem {
- id
- title
- price
- }
+ mutation addToCart($id: ID!) {
+ addToCart(id: $id) {
+ id
}
}
`;
export const REMOVE_FROM_CART_MUTATION = gql`
- mutation xxx($userId: ID!, $itemId: ID!) {
- removeFromCartItems(userUserId: $userId, cartItemId: $itemId) {
- cartItem {
- id
- title
- price
- }
+ mutation removeFromCart($id: ID!) {
+ removeFromCart(id: $id) {
+ id
}
}
`;