@doswiftly/storefront-operations 1.0.6 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fragments.graphql +153 -0
- package/mutations.graphql +66 -0
- package/package.json +1 -1
- package/queries.graphql +108 -0
package/fragments.graphql
CHANGED
|
@@ -1152,6 +1152,159 @@ fragment GenerateReferralCodePayload on GenerateReferralCodePayload {
|
|
|
1152
1152
|
userErrors
|
|
1153
1153
|
}
|
|
1154
1154
|
|
|
1155
|
+
# ============================================
|
|
1156
|
+
# Review Fragments
|
|
1157
|
+
# ============================================
|
|
1158
|
+
|
|
1159
|
+
fragment ProductReview on ProductReview {
|
|
1160
|
+
id
|
|
1161
|
+
productId
|
|
1162
|
+
rating
|
|
1163
|
+
title
|
|
1164
|
+
content
|
|
1165
|
+
pros
|
|
1166
|
+
cons
|
|
1167
|
+
images
|
|
1168
|
+
authorName
|
|
1169
|
+
isVerifiedPurchase
|
|
1170
|
+
helpfulCount
|
|
1171
|
+
response
|
|
1172
|
+
responseAt
|
|
1173
|
+
createdAt
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
fragment ReviewStats on ReviewStats {
|
|
1177
|
+
averageRating
|
|
1178
|
+
totalCount
|
|
1179
|
+
fiveStarCount
|
|
1180
|
+
fourStarCount
|
|
1181
|
+
threeStarCount
|
|
1182
|
+
twoStarCount
|
|
1183
|
+
oneStarCount
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
# ============================================
|
|
1187
|
+
# Wishlist Fragments
|
|
1188
|
+
# ============================================
|
|
1189
|
+
|
|
1190
|
+
fragment WishlistItem on WishlistItem {
|
|
1191
|
+
id
|
|
1192
|
+
productId
|
|
1193
|
+
variantId
|
|
1194
|
+
product {
|
|
1195
|
+
...ProductCard
|
|
1196
|
+
}
|
|
1197
|
+
priceAtAdd {
|
|
1198
|
+
...Money
|
|
1199
|
+
}
|
|
1200
|
+
notifyOnSale
|
|
1201
|
+
notifyOnRestock
|
|
1202
|
+
addedAt
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
fragment Wishlist on Wishlist {
|
|
1206
|
+
id
|
|
1207
|
+
name
|
|
1208
|
+
isPublic
|
|
1209
|
+
shareToken
|
|
1210
|
+
items {
|
|
1211
|
+
...WishlistItem
|
|
1212
|
+
}
|
|
1213
|
+
itemCount
|
|
1214
|
+
createdAt
|
|
1215
|
+
updatedAt
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
# ============================================
|
|
1219
|
+
# Blog Fragments
|
|
1220
|
+
# ============================================
|
|
1221
|
+
|
|
1222
|
+
fragment BlogCategory on BlogCategory {
|
|
1223
|
+
id
|
|
1224
|
+
name
|
|
1225
|
+
slug
|
|
1226
|
+
description
|
|
1227
|
+
postCount
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
fragment BlogTag on BlogTag {
|
|
1231
|
+
id
|
|
1232
|
+
name
|
|
1233
|
+
slug
|
|
1234
|
+
postCount
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
fragment BlogPost on BlogPost {
|
|
1238
|
+
id
|
|
1239
|
+
title
|
|
1240
|
+
slug
|
|
1241
|
+
excerpt
|
|
1242
|
+
content
|
|
1243
|
+
contentType
|
|
1244
|
+
featuredImage {
|
|
1245
|
+
...Image
|
|
1246
|
+
}
|
|
1247
|
+
author {
|
|
1248
|
+
id
|
|
1249
|
+
name
|
|
1250
|
+
bio
|
|
1251
|
+
avatar {
|
|
1252
|
+
...Image
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
category {
|
|
1256
|
+
...BlogCategory
|
|
1257
|
+
}
|
|
1258
|
+
tags {
|
|
1259
|
+
...BlogTag
|
|
1260
|
+
}
|
|
1261
|
+
publishedAt
|
|
1262
|
+
readingTime
|
|
1263
|
+
viewCount
|
|
1264
|
+
commentCount
|
|
1265
|
+
allowComments
|
|
1266
|
+
isFeatured
|
|
1267
|
+
status
|
|
1268
|
+
seo {
|
|
1269
|
+
title
|
|
1270
|
+
description
|
|
1271
|
+
}
|
|
1272
|
+
createdAt
|
|
1273
|
+
updatedAt
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
# ============================================
|
|
1277
|
+
# Recommendation Fragments
|
|
1278
|
+
# ============================================
|
|
1279
|
+
|
|
1280
|
+
fragment ProductRecommendation on ProductRecommendation {
|
|
1281
|
+
product {
|
|
1282
|
+
...ProductCard
|
|
1283
|
+
}
|
|
1284
|
+
type
|
|
1285
|
+
score
|
|
1286
|
+
reason
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
fragment CartRecommendation on CartRecommendations {
|
|
1290
|
+
frequentlyBoughtTogether {
|
|
1291
|
+
product {
|
|
1292
|
+
...ProductCard
|
|
1293
|
+
}
|
|
1294
|
+
type
|
|
1295
|
+
score
|
|
1296
|
+
reason
|
|
1297
|
+
}
|
|
1298
|
+
youMayAlsoLike {
|
|
1299
|
+
product {
|
|
1300
|
+
...ProductCard
|
|
1301
|
+
}
|
|
1302
|
+
type
|
|
1303
|
+
score
|
|
1304
|
+
reason
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1155
1308
|
# ============================================
|
|
1156
1309
|
# Inventory Level Fragments (Multi-Warehouse)
|
|
1157
1310
|
# ============================================
|
package/mutations.graphql
CHANGED
|
@@ -431,3 +431,69 @@ mutation GenerateReferralCode {
|
|
|
431
431
|
...GenerateReferralCodePayload
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
+
|
|
435
|
+
# ============================================
|
|
436
|
+
# Review Mutations
|
|
437
|
+
# ============================================
|
|
438
|
+
|
|
439
|
+
mutation ReviewCreate($input: ReviewCreateInput!) {
|
|
440
|
+
reviewCreate(input: $input) {
|
|
441
|
+
review {
|
|
442
|
+
...ProductReview
|
|
443
|
+
}
|
|
444
|
+
userErrors {
|
|
445
|
+
...UserError
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
mutation ReviewVote($reviewId: ID!, $isHelpful: Boolean!) {
|
|
451
|
+
reviewVote(reviewId: $reviewId, isHelpful: $isHelpful) {
|
|
452
|
+
review {
|
|
453
|
+
...ProductReview
|
|
454
|
+
}
|
|
455
|
+
userErrors {
|
|
456
|
+
...UserError
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
# ============================================
|
|
462
|
+
# Wishlist Mutations
|
|
463
|
+
# ============================================
|
|
464
|
+
|
|
465
|
+
mutation WishlistCreate($input: WishlistCreateInput!) {
|
|
466
|
+
wishlistCreate(input: $input) {
|
|
467
|
+
wishlist {
|
|
468
|
+
...Wishlist
|
|
469
|
+
}
|
|
470
|
+
userErrors
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
mutation WishlistAddItem($wishlistId: ID!, $input: WishlistItemInput!) {
|
|
475
|
+
wishlistAddItem(wishlistId: $wishlistId, input: $input) {
|
|
476
|
+
wishlist {
|
|
477
|
+
...Wishlist
|
|
478
|
+
}
|
|
479
|
+
userErrors
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
mutation WishlistRemoveItem($wishlistId: ID!, $itemId: ID!) {
|
|
484
|
+
wishlistRemoveItem(wishlistId: $wishlistId, itemId: $itemId) {
|
|
485
|
+
wishlist {
|
|
486
|
+
...Wishlist
|
|
487
|
+
}
|
|
488
|
+
userErrors
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
mutation WishlistDelete($wishlistId: ID!) {
|
|
493
|
+
wishlistDelete(wishlistId: $wishlistId) {
|
|
494
|
+
wishlist {
|
|
495
|
+
...Wishlist
|
|
496
|
+
}
|
|
497
|
+
userErrors
|
|
498
|
+
}
|
|
499
|
+
}
|
package/package.json
CHANGED
package/queries.graphql
CHANGED
|
@@ -368,3 +368,111 @@ query ReferralStats {
|
|
|
368
368
|
...ReferralStats
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
+
|
|
372
|
+
# ============================================
|
|
373
|
+
# Reviews
|
|
374
|
+
# ============================================
|
|
375
|
+
|
|
376
|
+
query ProductReviews($productId: ID!, $first: Int = 10, $after: String, $sortKey: ReviewSortKey = CREATED_AT, $reverse: Boolean = true) {
|
|
377
|
+
productReviews(productId: $productId, first: $first, after: $after, sortKey: $sortKey, reverse: $reverse) {
|
|
378
|
+
edges {
|
|
379
|
+
node {
|
|
380
|
+
...ProductReview
|
|
381
|
+
}
|
|
382
|
+
cursor
|
|
383
|
+
}
|
|
384
|
+
pageInfo {
|
|
385
|
+
...PageInfo
|
|
386
|
+
}
|
|
387
|
+
totalCount
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
query ReviewStats($productId: ID!) {
|
|
392
|
+
reviewStats(productId: $productId) {
|
|
393
|
+
...ReviewStats
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
# ============================================
|
|
398
|
+
# Wishlists
|
|
399
|
+
# ============================================
|
|
400
|
+
|
|
401
|
+
query Wishlists {
|
|
402
|
+
wishlists {
|
|
403
|
+
...Wishlist
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
query WishlistById($id: ID!) {
|
|
408
|
+
wishlist(id: $id) {
|
|
409
|
+
...Wishlist
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
# ============================================
|
|
414
|
+
# Blog
|
|
415
|
+
# ============================================
|
|
416
|
+
|
|
417
|
+
query BlogPosts($first: Int = 20, $after: String, $categorySlug: String, $tagSlug: String, $featured: Boolean, $sortKey: BlogPostSortKey = PUBLISHED_AT, $reverse: Boolean = false) {
|
|
418
|
+
blogPosts(first: $first, after: $after, categorySlug: $categorySlug, tagSlug: $tagSlug, featured: $featured, sortKey: $sortKey, reverse: $reverse) {
|
|
419
|
+
edges {
|
|
420
|
+
node {
|
|
421
|
+
...BlogPost
|
|
422
|
+
}
|
|
423
|
+
cursor
|
|
424
|
+
}
|
|
425
|
+
pageInfo {
|
|
426
|
+
...PageInfo
|
|
427
|
+
}
|
|
428
|
+
totalCount
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
query BlogPost($id: ID, $slug: String) {
|
|
433
|
+
blogPost(id: $id, slug: $slug) {
|
|
434
|
+
...BlogPost
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
query BlogCategories {
|
|
439
|
+
blogCategories {
|
|
440
|
+
...BlogCategory
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
query BlogTags {
|
|
445
|
+
blogTags {
|
|
446
|
+
...BlogTag
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
# ============================================
|
|
451
|
+
# Recommendations
|
|
452
|
+
# ============================================
|
|
453
|
+
|
|
454
|
+
query ProductRecommendations($productId: ID!, $limit: Int = 8, $intent: RecommendationIntent = SIMILAR) {
|
|
455
|
+
productRecommendations(productId: $productId, limit: $limit, intent: $intent) {
|
|
456
|
+
...ProductCard
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
query SimilarProducts($productId: String!, $first: Int = 6) {
|
|
461
|
+
similarProducts(productId: $productId, first: $first) {
|
|
462
|
+
items {
|
|
463
|
+
...ProductCard
|
|
464
|
+
}
|
|
465
|
+
totalCount
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
query CartRecommendations($cartId: String!, $first: Int = 4) {
|
|
470
|
+
cartRecommendations(cartId: $cartId, first: $first) {
|
|
471
|
+
frequentlyBoughtTogether {
|
|
472
|
+
...ProductCard
|
|
473
|
+
}
|
|
474
|
+
youMayAlsoLike {
|
|
475
|
+
...ProductCard
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|