File tree Expand file tree Collapse file tree 2 files changed +59
-65
lines changed Expand file tree Collapse file tree 2 files changed +59
-65
lines changed Original file line number Diff line number Diff line change 1
1
import { gql } from '@apollo/client' ;
2
2
export const ADD_TO_CART = gql `
3
3
mutation ($input: AddToCartInput!) {
4
+
4
5
addToCart(input: $input) {
5
- cartItem {
6
- key
7
- product {
6
+ cartItem {
7
+ key
8
+ product {
9
+ node {
8
10
id
9
11
databaseId
10
12
name
@@ -27,7 +29,9 @@ export const ADD_TO_CART = gql`
27
29
}
28
30
}
29
31
}
30
- variation {
32
+ }
33
+ variation {
34
+ node {
31
35
id
32
36
databaseId
33
37
name
@@ -51,13 +55,16 @@ export const ADD_TO_CART = gql`
51
55
}
52
56
}
53
57
}
54
- quantity
55
- total
56
- subtotal
57
- subtotalTax
58
58
}
59
+ quantity
60
+ total
61
+ subtotal
62
+ subtotalTax
59
63
}
60
64
}
65
+
66
+
67
+ }
61
68
` ;
62
69
export const CHECKOUT_MUTATION = gql `
63
70
mutation CHECKOUT_MUTATION($input: CheckoutInput!) {
Original file line number Diff line number Diff line change @@ -108,9 +108,8 @@ export const FETCH_FIRST_PRODUCTS_FROM_HOODIES_QUERY = `
108
108
*/
109
109
export const FETCH_ALL_PRODUCTS_QUERY = gql `
110
110
query MyQuery {
111
- products(first: 200 ) {
111
+ products(first: 50 ) {
112
112
nodes {
113
- id
114
113
databaseId
115
114
name
116
115
onSale
@@ -119,11 +118,13 @@ export const FETCH_ALL_PRODUCTS_QUERY = gql`
119
118
sourceUrl
120
119
}
121
120
... on SimpleProduct {
121
+ databaseId
122
122
price
123
123
regularPrice
124
124
salePrice
125
125
}
126
126
... on VariableProduct {
127
+ databaseId
127
128
price
128
129
regularPrice
129
130
salePrice
@@ -219,54 +220,58 @@ export const GET_CART = gql`
219
220
nodes {
220
221
key
221
222
product {
222
- id
223
- databaseId
224
- name
225
- description
226
- type
227
- onSale
228
- slug
229
- averageRating
230
- reviewCount
231
- image {
223
+ node {
232
224
id
233
- sourceUrl
234
- srcSet
235
- altText
236
- title
237
- }
238
- galleryImages {
239
- nodes {
225
+ databaseId
226
+ name
227
+ description
228
+ type
229
+ onSale
230
+ slug
231
+ averageRating
232
+ reviewCount
233
+ image {
240
234
id
241
235
sourceUrl
242
236
srcSet
243
237
altText
244
238
title
245
239
}
240
+ galleryImages {
241
+ nodes {
242
+ id
243
+ sourceUrl
244
+ srcSet
245
+ altText
246
+ title
247
+ }
248
+ }
246
249
}
247
250
}
248
251
variation {
249
- id
250
- databaseId
251
- name
252
- description
253
- type
254
- onSale
255
- price
256
- regularPrice
257
- salePrice
258
- image {
252
+ node {
259
253
id
260
- sourceUrl
261
- srcSet
262
- altText
263
- title
264
- }
265
- attributes {
266
- nodes {
254
+ databaseId
255
+ name
256
+ description
257
+ type
258
+ onSale
259
+ price
260
+ regularPrice
261
+ salePrice
262
+ image {
267
263
id
268
- name
269
- value
264
+ sourceUrl
265
+ srcSet
266
+ altText
267
+ title
268
+ }
269
+ attributes {
270
+ nodes {
271
+ id
272
+ name
273
+ value
274
+ }
270
275
}
271
276
}
272
277
}
@@ -276,25 +281,7 @@ export const GET_CART = gql`
276
281
subtotalTax
277
282
}
278
283
}
279
- appliedCoupons {
280
- nodes {
281
- id
282
- databaseId
283
- discountType
284
- amount
285
- dateExpiry
286
- products {
287
- nodes {
288
- id
289
- }
290
- }
291
- productCategories {
292
- nodes {
293
- id
294
- }
295
- }
296
- }
297
- }
284
+
298
285
subtotal
299
286
subtotalTax
300
287
shippingTax
You can’t perform that action at this time.
0 commit comments