summaryrefslogtreecommitdiffstats
path: root/frontend/queries/index.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-02-13 13:19:23 -0500
committerWes Bos <wesbos@gmail.com>2018-02-13 13:19:23 -0500
commitfa3ec3299b3fa33e5a699683beb96cfa4e6dd51d (patch)
tree601b4ff9650cd17a6d4181fc5982b401411d2a6a /frontend/queries/index.js
parente0d0baa75ec0bf617f91b6cd779305d4009cae12 (diff)
getting there
Diffstat (limited to 'frontend/queries/index.js')
-rw-r--r--frontend/queries/index.js33
1 files changed, 19 insertions, 14 deletions
diff --git a/frontend/queries/index.js b/frontend/queries/index.js
index e61a9d5..365c6f4 100644
--- a/frontend/queries/index.js
+++ b/frontend/queries/index.js
@@ -3,8 +3,8 @@ import { itemDetails } from './fragments';
export const CREATE_ITEM_MUTATION = gql`
${itemDetails}
- mutation createItem($description: String!, $title: String!, $price: Int!) {
- createItem(description: $description, title: $title, price: $price) {
+ mutation createItem($description: String!, $title: String!, $price: Int!, $image: String) {
+ createItem(description: $description, title: $title, price: $price, image: $image) {
...itemDetails
}
}
@@ -58,20 +58,14 @@ export const RESET_MUTATION = gql`
`;
export const CREATE_ORDER_MUTATION = gql`
- mutation CreateOrderMutation($token: String!, $userId: ID!, $itemId: ID!) {
- createOrder(token: $token, userId: $userId, itemId: $itemId) {
+ mutation CreateOrderMutation($token: String!) {
+ createOrder(token: $token) {
id
- token
charge
- amount
- item {
+ total
+ items {
id
title
- description
- }
- user {
- id
- email
}
}
}
@@ -85,8 +79,6 @@ export const ALL_ITEMS_QUERY = gql`
pageInfo {
hasNextPage
hasPreviousPage
- startCursor
- endCursor
}
aggregate {
count
@@ -161,6 +153,11 @@ export const CURRENT_USER_QUERY = gql`
id
email
name
+ orders {
+ charge
+ id
+ total
+ }
cart {
id
quantity
@@ -200,6 +197,14 @@ export const ADD_TO_CART_MUTATION = gql`
mutation addToCart($id: ID!) {
addToCart(id: $id) {
id
+ quantity
+ item {
+ id
+ price
+ description
+ image
+ title
+ }
}
}
`;