@doswiftly/storefront-operations 7.0.0 → 8.0.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 CHANGED
@@ -4,9 +4,10 @@
4
4
  # ============================================
5
5
 
6
6
  # ============================================
7
- # Common Fragments
7
+ # Common
8
8
  # ============================================
9
9
 
10
+ # Standard Relay Connection page metadata. Spread on every paginated query's `pageInfo`.
10
11
  fragment PageInfo on PageInfo {
11
12
  hasNextPage
12
13
  hasPreviousPage
@@ -14,19 +15,21 @@ fragment PageInfo on PageInfo {
14
15
  endCursor
15
16
  }
16
17
 
18
+ # Generic mutation error envelope — included in every mutation's `userErrors[]` field. Always check before consuming the happy-path payload.
17
19
  fragment UserError on UserError {
18
20
  message
19
21
  code
20
22
  field
21
23
  }
22
24
 
25
+ # Non-blocking cart warning (e.g. low stock, partial availability). Cart mutations succeed but surface these for UI hints.
23
26
  fragment CartWarning on CartWarning {
24
27
  message
25
28
  code
26
29
  target
27
30
  }
28
31
 
29
- # Base Image — no transform (for logos, favicons, branding assets that are already small)
32
+ # Base imageoriginal size, no transform. Use for logos, favicons, branding assets that are already sized correctly. ~few KB.
30
33
  fragment Image on Image {
31
34
  id
32
35
  url
@@ -35,8 +38,7 @@ fragment Image on Image {
35
38
  height
36
39
  }
37
40
 
38
- # Thumbnail — cart items, variant swatches, author avatars (rendered at ~96px, 300px covers 3x DPI)
39
- # No preferredContentType — imgproxy auto-negotiates AVIF/WEBP from Accept header
41
+ # Thumbnail — cart line items, variant swatches, author avatars (rendered ~96px on screen, transform delivers up to 300px for 3x DPI). Includes `thumbhash` for blurred placeholder. Format auto-negotiated from the `Accept` header.
40
42
  fragment ImageThumbnail on Image {
41
43
  id
42
44
  url(transform: { maxWidth: 300 })
@@ -46,7 +48,7 @@ fragment ImageThumbnail on Image {
46
48
  thumbhash
47
49
  }
48
50
 
49
- # Card — product cards, collection/category cards, blog posts (rendered at ~400px, 800px covers 2x DPI)
51
+ # Card — product cards, collection / category tiles, blog post previews (rendered ~400px, transform delivers up to 800px for 2x DPI). Includes `thumbhash` placeholder.
50
52
  fragment ImageCard on Image {
51
53
  id
52
54
  url(transform: { maxWidth: 800 })
@@ -56,7 +58,7 @@ fragment ImageCard on Image {
56
58
  thumbhash
57
59
  }
58
60
 
59
- # Full — product detail gallery, hero images (rendered at ~800px, 1600px covers 2x DPI)
61
+ # Full — product detail gallery, hero banners (rendered ~800px, transform delivers up to 1600px for 2x DPI). Includes `thumbhash` placeholder.
60
62
  fragment ImageFull on Image {
61
63
  id
62
64
  url(transform: { maxWidth: 1600 })
@@ -66,38 +68,23 @@ fragment ImageFull on Image {
66
68
  thumbhash
67
69
  }
68
70
 
69
- # Simple money (for originalPrice fields and non-converted prices)
71
+ # Plain `{ amount, currencyCode }` price. Use for `compareAtPrice`, totals, and any field where currency conversion transparency is not needed. `amount` is a String.
70
72
  fragment Money on Money {
71
73
  amount
72
74
  currencyCode
73
75
  }
74
76
 
75
- # Lightweight price for listing views (cards, grids, search results)
76
- fragment Price on PriceMoney {
77
- amount
78
- currencyCode
79
- }
80
-
81
- # Full price with conversion transparency (for price fields that support currency conversion)
82
- fragment PriceMoney on PriceMoney {
83
- ...Price
84
- baseAmount
85
- baseCurrencyCode
86
- exchangeRate
87
- marginApplied
88
- rateTimestamp
89
- isConverted
90
- }
91
-
77
+ # Selected variant option (e.g. `{ name: "Color", value: "Red" }`) on a `ProductVariant`. Use to render variant labels in cart / order summaries.
92
78
  fragment SelectedOption on SelectedOption {
93
79
  name
94
80
  value
95
81
  }
96
82
 
97
83
  # ============================================
98
- # Product Fragments
84
+ # Products
99
85
  # ============================================
100
86
 
87
+ # Single variant of a product — price, compare-at, stock flags, sort, image, selected options. Spread on cart line items, PDP variant selectors, search result rows that need price.
101
88
  fragment ProductVariant on ProductVariant {
102
89
  id
103
90
  title
@@ -124,14 +111,17 @@ fragment ProductVariant on ProductVariant {
124
111
  sortOrder
125
112
  }
126
113
 
127
- # Minimal product data for listing views (cards, grids, search results).
128
- # Matches template-local ProductCardFields for consistent typing.
114
+ # Minimal product shape for listing views (collection grids, search results, "you may also like"). Includes price range, featured image (card size), rating + review count, vendor, tags. Use for any list of products where you don't need variants/description.
129
115
  fragment ProductCard on Product {
130
116
  id
131
117
  handle
132
118
  title
133
119
  vendor
134
- category
120
+ categories {
121
+ id
122
+ slug
123
+ name
124
+ }
135
125
  isAvailable
136
126
  averageRating
137
127
  reviewCount
@@ -157,7 +147,7 @@ fragment ProductCard on Product {
157
147
  }
158
148
  }
159
149
 
160
- # Full product data for detail views and pages that need all fields.
150
+ # `ProductCard` plus textual content (description, descriptionHtml), stock total, type, visibility flags, and timestamps. Use when you need full product copy but not the heavy variants/images lists. Sweet spot for blog post embeds, related-product cards with description.
161
151
  fragment ProductBase on Product {
162
152
  ...ProductCard
163
153
  description
@@ -165,13 +155,13 @@ fragment ProductBase on Product {
165
155
  stockTotal
166
156
  type
167
157
  requiresRecipientInfo
168
- # Faza 1.5 (Decision D-A v3 + D-B)
169
158
  visibility
170
159
  attributeSetId
171
160
  createdAt
172
161
  updatedAt
173
162
  }
174
163
 
164
+ # Full product shape for the PDP — `ProductBase` plus the full image gallery (up to 20, full-size) and all variants (up to 100) with their pricing/stock. Spread on the product detail page.
175
165
  fragment ProductFull on Product {
176
166
  ...ProductBase
177
167
  images(first: 20) {
@@ -211,9 +201,10 @@ fragment ProductFull on Product {
211
201
  }
212
202
 
213
203
  # ============================================
214
- # Collection Fragments
204
+ # Collections
215
205
  # ============================================
216
206
 
207
+ # Collection (manual or rule-based product grouping) — title, description, hero image, SEO. Spread on collection landing pages and collection cards. Does NOT include products — query `collection(id, handle).products` separately for those.
217
208
  fragment Collection on Collection {
218
209
  id
219
210
  handle
@@ -232,9 +223,10 @@ fragment Collection on Collection {
232
223
  }
233
224
 
234
225
  # ============================================
235
- # Category Fragments
226
+ # Categories
236
227
  # ============================================
237
228
 
229
+ # Category node in the shop's taxonomy — name, slug, hero image, depth `level`, materialized `path`, product count, sort order. Spread on category cards and breadcrumb segments. Does NOT include parent / children — query those fields separately and let the server batch them.
238
230
  fragment Category on Category {
239
231
  id
240
232
  name
@@ -250,9 +242,10 @@ fragment Category on Category {
250
242
  }
251
243
 
252
244
  # ============================================
253
- # Customer Fragments
245
+ # Customer
254
246
  # ============================================
255
247
 
248
+ # Customer mailing address — full street/city/state/country/postal code with names and phone. `isDefault` flips when this address is the default for shipping. Spread on the address book UI and order summaries.
256
249
  fragment MailingAddress on MailingAddress {
257
250
  id
258
251
  streetLine1
@@ -270,11 +263,13 @@ fragment MailingAddress on MailingAddress {
270
263
  isDefault
271
264
  }
272
265
 
266
+ # Customer access token returned by `customerLogin` / `customerSignup` / `customerActivate` / `customerResetPassword` / `customerRefreshToken`. The token's JWT TTL is 24h; cookie max-age is 30d.
273
267
  fragment CustomerAccessToken on CustomerAccessToken {
274
268
  accessToken
275
269
  expiresAt
276
270
  }
277
271
 
272
+ # Customer profile — basic info plus B2B fields (`taxId`, `vatNumber`, `regon`, `companyName`), default address, lifetime stats (`orderCount`, `totalSpent`), marketing preferences. Use on profile / settings pages.
278
273
  fragment Customer on Customer {
279
274
  id
280
275
  email
@@ -301,6 +296,7 @@ fragment Customer on Customer {
301
296
  updatedAt
302
297
  }
303
298
 
299
+ # Order summary — number, totals (cost / tax / shipping), payment + fulfillment status, shipping address, item count, lifecycle timestamps. Spread on the order list and order detail pages. Line items are not included here.
304
300
  fragment Order on Order {
305
301
  id
306
302
  orderNumber
@@ -332,9 +328,10 @@ fragment Order on Order {
332
328
  }
333
329
 
334
330
  # ============================================
335
- # Cart Fragments
331
+ # Cart
336
332
  # ============================================
337
333
 
334
+ # Cart-level totals — subtotal, total, tax, duty, checkout charge. Spread inside the `Cart` fragment.
338
335
  fragment CartCost on CartCost {
339
336
  total {
340
337
  ...Money
@@ -353,6 +350,7 @@ fragment CartCost on CartCost {
353
350
  }
354
351
  }
355
352
 
353
+ # Per-line cost breakdown — unit price, line subtotal/total, compare-at unit price (for showing strikethroughs). Spread inside `CartLine`.
356
354
  fragment CartLineCost on CartLineCost {
357
355
  pricePerUnit {
358
356
  ...Money
@@ -368,8 +366,7 @@ fragment CartLineCost on CartLineCost {
368
366
  }
369
367
  }
370
368
 
371
- # Typed customer-filled attribute snapshot (Faza 1 R5 + Decision D-A v3 + D-I).
372
- # Distinct from CartLine.attributes (raw KV line item properties).
369
+ # Typed snapshot of a customer-filled product attribute (configurator selection) on a cart line. Includes the chosen option / text value, fillingMode, billingMode, surcharge, tax class, and any linked variant. Distinct from `CartLine.attributes` which holds raw key-value line item properties (free-form, untyped).
373
370
  fragment AttributeSelection on AttributeSelection {
374
371
  attributeDefinitionId
375
372
  attributeName
@@ -386,6 +383,7 @@ fragment AttributeSelection on AttributeSelection {
386
383
  linkedVariantId
387
384
  }
388
385
 
386
+ # A single line in the cart — variant + quantity + per-line cost, plus dual attribute storage: `attributes[]` for free-form key-value properties (gift wrap, engraving notes), `attributeSelections[]` for typed configurator answers.
389
387
  fragment CartLine on CartLine {
390
388
  id
391
389
  quantity
@@ -408,17 +406,20 @@ fragment CartLine on CartLine {
408
406
  productType
409
407
  }
410
408
 
409
+ # Buyer identity associated with the cart. Note: only `customerId` is currently persisted server-side; `email`, `phone`, `countryCode` are accepted in the input but ignored.
411
410
  fragment CartBuyerIdentity on CartBuyerIdentity {
412
411
  email
413
412
  phone
414
413
  countryCode
415
414
  }
416
415
 
416
+ # Discount code applied to the cart with its `isApplicable` flag — false means the code was kept on the cart but does not currently qualify (e.g. minimum spend not reached).
417
417
  fragment CartDiscountCode on CartDiscountCode {
418
418
  code
419
419
  isApplicable
420
420
  }
421
421
 
422
+ # Allocation of a discount code to the cart total — pairs the code with the actual money discounted. Use to show "saved X with code Y" in cart UI.
422
423
  fragment CartDiscountAllocation on CartDiscountAllocation {
423
424
  discountCode
424
425
  amount {
@@ -426,6 +427,7 @@ fragment CartDiscountAllocation on CartDiscountAllocation {
426
427
  }
427
428
  }
428
429
 
430
+ # Full cart shape — totals, line items (paginated up to 100), buyer identity, applied discount codes + allocations, note, custom attributes. Spread on the cart drawer / cart page; refetch after every cart mutation.
429
431
  fragment Cart on Cart {
430
432
  id
431
433
  checkoutUrl
@@ -471,9 +473,10 @@ fragment Cart on Cart {
471
473
  }
472
474
 
473
475
  # ============================================
474
- # Shop Fragments
476
+ # Shop
475
477
  # ============================================
476
478
 
479
+ # Shop branding colors — primary, secondary, accent, background, text. Use to theme the storefront from server-side config.
477
480
  fragment ShopColors on ShopColors {
478
481
  primary
479
482
  secondary
@@ -482,11 +485,13 @@ fragment ShopColors on ShopColors {
482
485
  text
483
486
  }
484
487
 
488
+ # Shop branding fonts — body (`primary`) and `heading` font families.
485
489
  fragment ShopFonts on ShopFonts {
486
490
  primary
487
491
  heading
488
492
  }
489
493
 
494
+ # Social media links configured for the shop. Spread on the footer.
490
495
  fragment SocialLinks on SocialLinks {
491
496
  facebook
492
497
  instagram
@@ -497,6 +502,7 @@ fragment SocialLinks on SocialLinks {
497
502
  pinterest
498
503
  }
499
504
 
505
+ # Shop's physical / business address. Use on the contact page and footer.
500
506
  fragment ShopAddress on ShopAddress {
501
507
  streetLine1
502
508
  streetLine2
@@ -506,6 +512,7 @@ fragment ShopAddress on ShopAddress {
506
512
  country
507
513
  }
508
514
 
515
+ # One day's business hours window. Spread inside `Shop.businessHours[]`.
509
516
  fragment BusinessHour on BusinessHour {
510
517
  day
511
518
  openTime
@@ -513,6 +520,7 @@ fragment BusinessHour on BusinessHour {
513
520
  isClosed
514
521
  }
515
522
 
523
+ # Full shop branding bundle — logo + favicon + colors + fonts + social links. Spread inside the `Shop` fragment.
516
524
  fragment ShopBranding on ShopBranding {
517
525
  logo {
518
526
  ...Image
@@ -531,12 +539,14 @@ fragment ShopBranding on ShopBranding {
531
539
  }
532
540
  }
533
541
 
542
+ # Bot-protection provider config (provider name, site key, script URL) for storefront-side challenge widgets.
534
543
  fragment BotProtectionProvider on BotProtectionProviderInfo {
535
544
  provider
536
545
  siteKey
537
546
  scriptUrl
538
547
  }
539
548
 
549
+ # Bot-protection setup for the shop — primary + fallback provider, and the list of `protectedOperations` (mutation names that require a challenge token). Spread inside `Shop`.
540
550
  fragment BotProtection on BotProtectionInfo {
541
551
  primary {
542
552
  ...BotProtectionProvider
@@ -547,6 +557,7 @@ fragment BotProtection on BotProtectionInfo {
547
557
  protectedOperations
548
558
  }
549
559
 
560
+ # The shop itself — name, primary domain, currencies + locales, branding, contact info, business hours, bot-protection config. Spread on the root `shop` query; cache for the session.
550
561
  fragment Shop on Shop {
551
562
  id
552
563
  name
@@ -581,9 +592,10 @@ fragment Shop on Shop {
581
592
  }
582
593
 
583
594
  # ============================================
584
- # Payment Method Fragments (R23 - Payment Methods)
595
+ # Payment Methods
585
596
  # ============================================
586
597
 
598
+ # Single payment method enabled for the shop — type (CARD / BANK_TRANSFER / BLIK / PAYPAL / APPLE_PAY / GOOGLE_PAY / CASH_ON_DELIVERY / OTHER), provider, icon, supported currencies, default flag, sort position. Spread on the checkout payment step.
587
599
  fragment PaymentMethod on PaymentMethod {
588
600
  id
589
601
  name
@@ -596,6 +608,7 @@ fragment PaymentMethod on PaymentMethod {
596
608
  position
597
609
  }
598
610
 
611
+ # Active payment methods list with the merchant's `defaultMethod`. Returned by the `availablePaymentMethods` query.
599
612
  fragment AvailablePaymentMethods on AvailablePaymentMethods {
600
613
  methods {
601
614
  ...PaymentMethod
@@ -606,9 +619,10 @@ fragment AvailablePaymentMethods on AvailablePaymentMethods {
606
619
  }
607
620
 
608
621
  # ============================================
609
- # Checkout Fragments
622
+ # Checkout
610
623
  # ============================================
611
624
 
625
+ # Single shipping rate option — `handle` is the stable id you pass to `checkoutSelectShippingRate` as `rateId`, plus title and price.
612
626
  fragment ShippingRate on ShippingRate {
613
627
  handle
614
628
  title
@@ -617,6 +631,7 @@ fragment ShippingRate on ShippingRate {
617
631
  }
618
632
  }
619
633
 
634
+ # One tax line on the checkout — title, rate (decimal, e.g. 0.23 for 23%), computed amount. Spread on the order summary.
620
635
  fragment TaxLine on TaxLine {
621
636
  title
622
637
  rate
@@ -625,6 +640,7 @@ fragment TaxLine on TaxLine {
625
640
  }
626
641
  }
627
642
 
643
+ # Item affected by a discount — the discounted product/variant with original + discounted prices and savings. Used on Buy-X-Get-Y promotions to highlight which items the discount applies to.
628
644
  fragment DiscountAffectedItem on DiscountAffectedItem {
629
645
  productId
630
646
  variantId
@@ -642,6 +658,7 @@ fragment DiscountAffectedItem on DiscountAffectedItem {
642
658
  isFreeItem
643
659
  }
644
660
 
661
+ # A discount currently applied to the checkout — code, type, value, plus BXGY (Buy X Get Y) metadata when applicable (`buyQuantity`, `getQuantity`, `getDiscountPercent`, `affectedItems`). Use to render a "Discounts applied" panel.
645
662
  fragment DiscountApplication on DiscountApplication {
646
663
  code
647
664
  isApplicable
@@ -650,7 +667,6 @@ fragment DiscountApplication on DiscountApplication {
650
667
  ...Money
651
668
  }
652
669
  title
653
- # BXGY (Buy X Get Y) specific fields
654
670
  affectedItems {
655
671
  ...DiscountAffectedItem
656
672
  }
@@ -659,11 +675,13 @@ fragment DiscountApplication on DiscountApplication {
659
675
  getDiscountPercent
660
676
  }
661
677
 
678
+ # Lightweight discount code entry on the checkout — code + applicability flag.
662
679
  fragment DiscountCode on DiscountCode {
663
680
  code
664
681
  isApplicable
665
682
  }
666
683
 
684
+ # Single line item in the checkout — variant snapshot, quantity, unit + total prices, image. Use on the order summary panel.
667
685
  fragment CheckoutLineItem on CheckoutLineItem {
668
686
  id
669
687
  title
@@ -683,7 +701,7 @@ fragment CheckoutLineItem on CheckoutLineItem {
683
701
  }
684
702
  }
685
703
 
686
- # GAP-001: Gift Card Checkout Integration
704
+ # Gift card applied to the checkout — `maskedCode` (first + last 4 chars), `lastCharacters` (for display matching), the amount applied to this checkout, and remaining balance after this order would complete.
687
705
  fragment AppliedGiftCard on AppliedGiftCard {
688
706
  maskedCode
689
707
  lastCharacters
@@ -695,6 +713,7 @@ fragment AppliedGiftCard on AppliedGiftCard {
695
713
  }
696
714
  }
697
715
 
716
+ # Full checkout shape — line items, shipping + billing addresses, selected + available shipping rates, available payment methods, applied discounts + gift cards, tax lines, totals (`cost`, `paymentDue`, `totalGiftCardAmount`). Spread on the checkout flow; refetch after every checkout mutation. `isReady` flips to true when the checkout has all required fields to call `checkoutComplete`.
698
717
  fragment Checkout on Checkout {
699
718
  id
700
719
  isReady
@@ -741,7 +760,6 @@ fragment Checkout on Checkout {
741
760
  taxLines {
742
761
  ...TaxLine
743
762
  }
744
- # GAP-001: Gift Card Checkout Integration
745
763
  appliedGiftCards {
746
764
  ...AppliedGiftCard
747
765
  }
@@ -758,9 +776,10 @@ fragment Checkout on Checkout {
758
776
  }
759
777
 
760
778
  # ============================================
761
- # Shipment Fragments (R29 - Shipment Tracking)
779
+ # Shipments / Tracking
762
780
  # ============================================
763
781
 
782
+ # One tracking event in the shipment timeline — status, description, location, timestamp. Spread on the tracking page timeline.
764
783
  fragment ShipmentEvent on ShipmentEvent {
765
784
  id
766
785
  status
@@ -770,6 +789,7 @@ fragment ShipmentEvent on ShipmentEvent {
770
789
  providerEventCode
771
790
  }
772
791
 
792
+ # Physical package metadata (weight + dimensions). Used in the merchant's label generation; storefronts rarely render this directly.
773
793
  fragment ShipmentPackage on ShipmentPackage {
774
794
  weight
775
795
  length
@@ -777,6 +797,7 @@ fragment ShipmentPackage on ShipmentPackage {
777
797
  height
778
798
  }
779
799
 
800
+ # One item in a shipment — title, variant, sku, quantity, image URL. Spread inside `Shipment.items[]` for the tracking page item list.
780
801
  fragment ShipmentItem on ShipmentItem {
781
802
  id
782
803
  title
@@ -786,6 +807,7 @@ fragment ShipmentItem on ShipmentItem {
786
807
  imageUrl
787
808
  }
788
809
 
810
+ # Full shipment shape — provider, tracking number + URL, label URL, status, ETA, recipient address, packages, items, full event timeline. Spread on the tracking page.
789
811
  fragment Shipment on Shipment {
790
812
  id
791
813
  orderId
@@ -814,6 +836,7 @@ fragment Shipment on Shipment {
814
836
  updatedAt
815
837
  }
816
838
 
839
+ # Lightweight shipment shape — id, tracking number + URL, status, dates. No items / events / address. Use for order summary cards or on the public `shipmentByTrackingNumber` query.
817
840
  fragment ShipmentBasic on Shipment {
818
841
  id
819
842
  orderId
@@ -828,9 +851,10 @@ fragment ShipmentBasic on Shipment {
828
851
  }
829
852
 
830
853
  # ============================================
831
- # Return Fragments (R30 - Returns/RMA)
854
+ # Returns / RMA
832
855
  # ============================================
833
856
 
857
+ # Return shipping label generated by the carrier — URL to download, carrier name, tracking number, expiry. Spread on the return detail page.
834
858
  fragment ReturnShippingLabel on ReturnShippingLabel {
835
859
  url
836
860
  carrier
@@ -838,6 +862,7 @@ fragment ReturnShippingLabel on ReturnShippingLabel {
838
862
  expiresAt
839
863
  }
840
864
 
865
+ # Photo evidence attached to a return item (e.g. damage photo). Spread inside `ReturnItem.photos[]`.
841
866
  fragment ReturnItemPhoto on ReturnItemPhoto {
842
867
  id
843
868
  url
@@ -846,6 +871,7 @@ fragment ReturnItemPhoto on ReturnItemPhoto {
846
871
  createdAt
847
872
  }
848
873
 
874
+ # Single line in a return request — variant identity, quantity requested, reason, condition, photos, status, approved quantity (set by merchant after review). Spread inside `Return.items[]`.
849
875
  fragment ReturnItem on ReturnItem {
850
876
  id
851
877
  variantId
@@ -866,6 +892,7 @@ fragment ReturnItem on ReturnItem {
866
892
  approvedQuantity
867
893
  }
868
894
 
895
+ # Full return shape — number, parent order, status, reason, customer note, compensation type (`REFUND` / `STORE_CREDIT`), items, refund amount, shipping label, lifecycle timestamps. Spread on the return detail page.
869
896
  fragment Return on Return {
870
897
  id
871
898
  returnNumber
@@ -893,6 +920,7 @@ fragment Return on Return {
893
920
  updatedAt
894
921
  }
895
922
 
923
+ # Single option in the return reasons dropdown — `value` enum, human-readable `label`, optional `description`. Returned by `returnReasons` query.
896
924
  fragment ReturnReasonOption on ReturnReasonOption {
897
925
  value
898
926
  label
@@ -900,9 +928,10 @@ fragment ReturnReasonOption on ReturnReasonOption {
900
928
  }
901
929
 
902
930
  # ============================================
903
- # Gift Card Fragments (R32 - Gift Cards)
931
+ # Gift Cards
904
932
  # ============================================
905
933
 
934
+ # Gift card detail — masked code (first + last 4 chars), status, initial + remaining balance, expiry, recipient/message. Returned by `giftCard($code)` query.
906
935
  fragment GiftCard on GiftCard {
907
936
  id
908
937
  maskedCode
@@ -919,11 +948,13 @@ fragment GiftCard on GiftCard {
919
948
  createdAt
920
949
  }
921
950
 
951
+ # Validation error on a gift card check — code (`NOT_FOUND` / `DISABLED` / `ALREADY_USED` / `EXPIRED` / `INSUFFICIENT_BALANCE`) + human message.
922
952
  fragment GiftCardError on GiftCardError {
923
953
  code
924
954
  message
925
955
  }
926
956
 
957
+ # Result of `giftCardValidate($code, $amount)` — `isValid` flag, available balance, optional `error` (when invalid), and the matched gift card (when found). Use to inline-validate gift card inputs before applying.
927
958
  fragment GiftCardValidation on GiftCardValidation {
928
959
  isValid
929
960
  availableBalance {
@@ -938,9 +969,10 @@ fragment GiftCardValidation on GiftCardValidation {
938
969
  }
939
970
 
940
971
  # ============================================
941
- # Shipping Method Fragments (R33 - Shipping Methods)
972
+ # Shipping Methods
942
973
  # ============================================
943
974
 
975
+ # Carrier offering the shipping method — id, display name, logo URL, internal service code.
944
976
  fragment ShippingCarrier on ShippingCarrier {
945
977
  id
946
978
  name
@@ -948,12 +980,14 @@ fragment ShippingCarrier on ShippingCarrier {
948
980
  serviceCode
949
981
  }
950
982
 
983
+ # Estimated delivery window — `minDays` to `maxDays` plus a human-readable description (e.g. "2-4 business days").
951
984
  fragment DeliveryEstimate on DeliveryEstimate {
952
985
  minDays
953
986
  maxDays
954
987
  description
955
988
  }
956
989
 
990
+ # Free-shipping progress info — `qualifies` flag, current cart amount, threshold, remaining to qualify, percent progress, and a localized message ("Add 20 PLN more for free shipping"). Use to render a free-shipping progress bar in the cart drawer.
957
991
  fragment FreeShippingProgress on FreeShippingProgress {
958
992
  qualifies
959
993
  currentAmount {
@@ -969,6 +1003,7 @@ fragment FreeShippingProgress on FreeShippingProgress {
969
1003
  message
970
1004
  }
971
1005
 
1006
+ # One shipping method offered for the destination + cart — id, name, carrier, price, free-shipping progress, estimated delivery, sort order. Spread on the checkout shipping step.
972
1007
  fragment AvailableShippingMethod on AvailableShippingMethod {
973
1008
  id
974
1009
  name
@@ -990,20 +1025,23 @@ fragment AvailableShippingMethod on AvailableShippingMethod {
990
1025
  }
991
1026
 
992
1027
  # ============================================
993
- # Attribute Filter Fragments (R35 - Dynamic Attributes)
1028
+ # Attribute Filters
994
1029
  # ============================================
995
1030
 
1031
+ # Visual swatch for an attribute filter value — color hex (for color filters) or image URL (for pattern/material swatches).
996
1032
  fragment AttributeSwatch on AttributeSwatch {
997
1033
  colorHex
998
1034
  imageUrl
999
1035
  }
1000
1036
 
1037
+ # Numeric range bounds for slider-style filters — min, max, currency code (when relevant).
1001
1038
  fragment AttributeRangeBounds on AttributeRangeBounds {
1002
1039
  min
1003
1040
  max
1004
1041
  currencyCode
1005
1042
  }
1006
1043
 
1044
+ # One discrete value in a filterable attribute (e.g. "Red" for the Color filter). Includes `productCount` in the current listing context (for "(12)" badges next to filter values), optional swatch and price modifier.
1007
1045
  fragment AttributeFilterValue on AttributeFilterValue {
1008
1046
  id
1009
1047
  value
@@ -1018,6 +1056,7 @@ fragment AttributeFilterValue on AttributeFilterValue {
1018
1056
  sortOrder
1019
1057
  }
1020
1058
 
1059
+ # Filterable attribute exposed on the storefront — name, type (SELECT / CHECKBOX / SLIDER / etc.), filterability flags, display order, and either discrete `filterValues[]` or numeric `rangeBounds`. Spread inside `availableFilters.attributes[]`.
1021
1060
  fragment AttributeDefinition on AttributeDefinition {
1022
1061
  id
1023
1062
  name
@@ -1034,6 +1073,7 @@ fragment AttributeDefinition on AttributeDefinition {
1034
1073
  }
1035
1074
  }
1036
1075
 
1076
+ # Min / max price range across products in the current listing context. Use to bound the price slider.
1037
1077
  fragment PriceRangeFilter on PriceRange {
1038
1078
  min {
1039
1079
  ...Money
@@ -1043,6 +1083,7 @@ fragment PriceRangeFilter on PriceRange {
1043
1083
  }
1044
1084
  }
1045
1085
 
1086
+ # One category option in the categories filter — id, name, slug, count of products in this category within the current listing context, level + parentId for tree rendering.
1046
1087
  fragment CategoryFilterOption on CategoryFilterOption {
1047
1088
  id
1048
1089
  name
@@ -1052,6 +1093,7 @@ fragment CategoryFilterOption on CategoryFilterOption {
1052
1093
  parentId
1053
1094
  }
1054
1095
 
1096
+ # Full result of the `productFilters($input)` query — attribute filters, price range, category filters, count of currently active filters, total products matching the context. Spread on listing pages to render filter sidebars.
1055
1097
  fragment AvailableFilters on AvailableFilters {
1056
1098
  attributes {
1057
1099
  ...AttributeDefinition
@@ -1062,14 +1104,15 @@ fragment AvailableFilters on AvailableFilters {
1062
1104
  categories {
1063
1105
  ...CategoryFilterOption
1064
1106
  }
1065
- activeFilterCount
1066
- totalProducts
1107
+ activeCount
1108
+ matchCount
1067
1109
  }
1068
1110
 
1069
1111
  # ============================================
1070
- # Loyalty Program Fragments
1112
+ # Loyalty Program
1071
1113
  # ============================================
1072
1114
 
1115
+ # Page metadata for the loyalty transactions connection (separate type from generic `PageInfo` for legacy reasons; identical shape).
1073
1116
  fragment LoyaltyPageInfo on LoyaltyPageInfo {
1074
1117
  hasNextPage
1075
1118
  hasPreviousPage
@@ -1077,6 +1120,7 @@ fragment LoyaltyPageInfo on LoyaltyPageInfo {
1077
1120
  endCursor
1078
1121
  }
1079
1122
 
1123
+ # Loyalty tier definition — name, type enum (`BRONZE` / `SILVER` / `GOLD` / `PLATINUM` / `DIAMOND`), entry threshold (`minPoints` and/or `minAnnualSpend`), points multiplier, custom benefits list. Returned by `loyaltyTiers` and embedded in member tier data.
1080
1124
  fragment LoyaltyTier on LoyaltyTier {
1081
1125
  id
1082
1126
  name
@@ -1093,6 +1137,7 @@ fragment LoyaltyTier on LoyaltyTier {
1093
1137
  }
1094
1138
  }
1095
1139
 
1140
+ # Customer's points breakdown — total earned, currently spendable, pending (not yet vested), redeemed lifetime, expired lifetime, expiring soon, and the next expiry date. Spread inside `LoyaltyMember`.
1096
1141
  fragment LoyaltyPointsSummary on LoyaltyPointsSummary {
1097
1142
  totalPoints
1098
1143
  currentPoints
@@ -1103,6 +1148,7 @@ fragment LoyaltyPointsSummary on LoyaltyPointsSummary {
1103
1148
  nextExpiryDate
1104
1149
  }
1105
1150
 
1151
+ # Customer's progress toward the next tier — current tier, next tier, points + spend remaining, percent progress. Use to render the "X points to GOLD" tracker.
1106
1152
  fragment TierProgress on TierProgress {
1107
1153
  currentTier {
1108
1154
  ...LoyaltyTier
@@ -1117,6 +1163,7 @@ fragment TierProgress on TierProgress {
1117
1163
  }
1118
1164
  }
1119
1165
 
1166
+ # Customer's loyalty membership — points summary, current tier, tier progress, annual spend, last activity. Returned by `loyaltyMember` (null if not enrolled).
1120
1167
  fragment LoyaltyMember on LoyaltyMember {
1121
1168
  id
1122
1169
  customerId
@@ -1136,6 +1183,7 @@ fragment LoyaltyMember on LoyaltyMember {
1136
1183
  enrolledAt
1137
1184
  }
1138
1185
 
1186
+ # One row in the loyalty points history — type (`EARN_PURCHASE` / `EARN_SIGNUP` / `EARN_REFERRAL` / `EARN_REVIEW` / `EARN_BIRTHDAY` / `EARN_BONUS` / `REDEEM` / `EXPIRE` / `ADJUST` / `REFUND_REVERSAL`), points delta, balance after, source order, expiry. Spread on the loyalty dashboard transaction list.
1139
1187
  fragment LoyaltyTransaction on LoyaltyTransaction {
1140
1188
  id
1141
1189
  type
@@ -1147,6 +1195,7 @@ fragment LoyaltyTransaction on LoyaltyTransaction {
1147
1195
  createdAt
1148
1196
  }
1149
1197
 
1198
+ # Reward customers can redeem — name, type, points cost, discount value (% or fixed), tier requirement, availability flag, remaining redemptions. Spread on the rewards page.
1150
1199
  fragment LoyaltyReward on LoyaltyReward {
1151
1200
  id
1152
1201
  name
@@ -1168,6 +1217,7 @@ fragment LoyaltyReward on LoyaltyReward {
1168
1217
  redemptionsRemaining
1169
1218
  }
1170
1219
 
1220
+ # Estimated points for an order — base points, bonus points (tier multiplier applied), total, multiplier used. Returned by `estimatePoints($orderTotal)` for "Earn X points" UI on cart/checkout.
1171
1221
  fragment PointsEstimate on PointsEstimate {
1172
1222
  basePoints
1173
1223
  bonusPoints
@@ -1175,12 +1225,14 @@ fragment PointsEstimate on PointsEstimate {
1175
1225
  multiplier
1176
1226
  }
1177
1227
 
1228
+ # One earn action configured in the loyalty program — type (`PURCHASE` / `SIGNUP` / `REFERRAL` / `REVIEW` / `BIRTHDAY`), enabled flag, points granted.
1178
1229
  fragment LoyaltyAction on LoyaltyAction {
1179
1230
  type
1180
1231
  isEnabled
1181
1232
  points
1182
1233
  }
1183
1234
 
1235
+ # Loyalty program configuration — `isEnabled` (use to gate UI rendering), points name (e.g. "stars"), earn rate, expiry policy, available actions, referral settings. Returned by `loyaltySettings`.
1184
1236
  fragment LoyaltySettings on LoyaltySettings {
1185
1237
  isEnabled
1186
1238
  pointsName
@@ -1194,6 +1246,7 @@ fragment LoyaltySettings on LoyaltySettings {
1194
1246
  referralBonusPoints
1195
1247
  }
1196
1248
 
1249
+ # Customer referral statistics — code, share URL, counts of referred / completed / pending, lifetime points earned. Returned by `referralStats`.
1197
1250
  fragment ReferralStats on ReferralStats {
1198
1251
  referralCode
1199
1252
  shareUrl
@@ -1203,26 +1256,32 @@ fragment ReferralStats on ReferralStats {
1203
1256
  totalPointsEarned
1204
1257
  }
1205
1258
 
1206
- # GAP-003: PRODUCT and GIFT_CARD Reward Types
1259
+ # Result of `loyaltyRedeemReward` depending on the reward type, exactly one of `discountCode`, `productDiscountCode`, `giftCardCode` is populated. Apply the returned code on cart/checkout.
1207
1260
  fragment RedeemRewardPayload on RedeemRewardPayload {
1208
1261
  success
1209
1262
  discountCode
1210
1263
  productDiscountCode
1211
1264
  giftCardCode
1212
- userErrors
1265
+ userErrors {
1266
+ ...UserError
1267
+ }
1213
1268
  }
1214
1269
 
1270
+ # Result of `loyaltyGenerateReferralCode` — the customer's referral code and shareable URL.
1215
1271
  fragment GenerateReferralCodePayload on GenerateReferralCodePayload {
1216
1272
  success
1217
1273
  referralCode
1218
1274
  shareUrl
1219
- userErrors
1275
+ userErrors {
1276
+ ...UserError
1277
+ }
1220
1278
  }
1221
1279
 
1222
1280
  # ============================================
1223
- # Review Fragments
1281
+ # Reviews
1224
1282
  # ============================================
1225
1283
 
1284
+ # Single product review — rating, title, body, optional pros/cons, image attachments, author, verified-purchase flag, helpful/unhelpful counts, optional merchant response. Only `APPROVED` reviews are exposed to the storefront.
1226
1285
  fragment ProductReview on ProductReview {
1227
1286
  id
1228
1287
  productId
@@ -1241,6 +1300,7 @@ fragment ProductReview on ProductReview {
1241
1300
  createdAt
1242
1301
  }
1243
1302
 
1303
+ # Aggregate review stats for a product — average rating, total count, distribution per star (1-5). Returned by `reviewStats($productId)`.
1244
1304
  fragment ReviewStats on ReviewStats {
1245
1305
  averageRating
1246
1306
  totalCount
@@ -1252,9 +1312,10 @@ fragment ReviewStats on ReviewStats {
1252
1312
  }
1253
1313
 
1254
1314
  # ============================================
1255
- # Wishlist Fragments
1315
+ # Wishlists
1256
1316
  # ============================================
1257
1317
 
1318
+ # One item in a wishlist — references the product and (optionally) a specific variant, snapshots the price at the time it was added, plus notification preferences (`notifyOnSale`, `notifyOnRestock`).
1258
1319
  fragment WishlistItem on WishlistItem {
1259
1320
  id
1260
1321
  productId
@@ -1270,6 +1331,7 @@ fragment WishlistItem on WishlistItem {
1270
1331
  addedAt
1271
1332
  }
1272
1333
 
1334
+ # A customer's wishlist — name, public/private flag, share token (when public), items, item count. Spread on the wishlists page.
1273
1335
  fragment Wishlist on Wishlist {
1274
1336
  id
1275
1337
  name
@@ -1284,9 +1346,10 @@ fragment Wishlist on Wishlist {
1284
1346
  }
1285
1347
 
1286
1348
  # ============================================
1287
- # Blog Fragments
1349
+ # Blog
1288
1350
  # ============================================
1289
1351
 
1352
+ # Blog category — name, slug, description, post count. Spread on category navigation and post category labels.
1290
1353
  fragment BlogCategory on BlogCategory {
1291
1354
  id
1292
1355
  name
@@ -1295,6 +1358,7 @@ fragment BlogCategory on BlogCategory {
1295
1358
  postCount
1296
1359
  }
1297
1360
 
1361
+ # Blog tag — name, slug, post count. Spread on tag clouds and post tag labels.
1298
1362
  fragment BlogTag on BlogTag {
1299
1363
  id
1300
1364
  name
@@ -1302,6 +1366,7 @@ fragment BlogTag on BlogTag {
1302
1366
  postCount
1303
1367
  }
1304
1368
 
1369
+ # Full blog post — title, slug, excerpt, content (with `contentFormat` indicating HTML/Markdown), featured image, author, category, tags, publish date, reading time, view + comment counts, SEO metadata. Spread on the post detail page.
1305
1370
  fragment BlogPost on BlogPost {
1306
1371
  id
1307
1372
  title
@@ -1341,47 +1406,17 @@ fragment BlogPost on BlogPost {
1341
1406
  updatedAt
1342
1407
  }
1343
1408
 
1344
- # ============================================
1345
- # Recommendation Fragments
1346
- # ============================================
1347
-
1348
- fragment ProductRecommendation on ProductRecommendation {
1349
- product {
1350
- ...ProductCard
1351
- }
1352
- type
1353
- score
1354
- reason
1355
- }
1356
-
1357
- fragment CartRecommendation on CartRecommendations {
1358
- frequentlyBoughtTogether {
1359
- product {
1360
- ...ProductCard
1361
- }
1362
- type
1363
- score
1364
- reason
1365
- }
1366
- youMayAlsoLike {
1367
- product {
1368
- ...ProductCard
1369
- }
1370
- type
1371
- score
1372
- reason
1373
- }
1374
- }
1375
1409
 
1376
1410
  # ============================================
1377
- # Store Availability Fragments (BOPIS / multi-location)
1411
+ # Store Availability (BOPIS / multi-location)
1378
1412
  # ============================================
1379
- # Field access:
1380
- # - `available: Boolean!` — always public.
1381
- # - `pickupTime: String` — public, localized merchant-configured string.
1382
- # - `quantityAvailable: Int` — TOKEN-GATED (null for anonymous, Int for authenticated).
1383
- # - `location: Location!` — public, includes coords + businessHours when configured.
1413
+ # Field-access notes:
1414
+ # - `isAvailable` — always public.
1415
+ # - `pickupTime` — public, localized merchant-configured string.
1416
+ # - `availableStock` — token-gated (null for anonymous, integer for authenticated customers).
1417
+ # - `location` — public, includes coords + business hours when configured.
1384
1418
 
1419
+ # Physical location address — street, city, country, state, postal code, phone, lat/lng, formatted single-line representation. Spread inside `Location.address`.
1385
1420
  fragment LocationAddress on LocationAddress {
1386
1421
  streetLine1
1387
1422
  streetLine2
@@ -1397,11 +1432,13 @@ fragment LocationAddress on LocationAddress {
1397
1432
  formatted
1398
1433
  }
1399
1434
 
1435
+ # One day's open/close window inside `BusinessHours` (24h clock).
1400
1436
  fragment BusinessHoursWindow on BusinessHoursWindow {
1401
1437
  openHour
1402
1438
  closeHour
1403
1439
  }
1404
1440
 
1441
+ # Weekly business hours — one window per day. Spread inside `Location.businessHours`.
1405
1442
  fragment BusinessHours on BusinessHours {
1406
1443
  monday { ...BusinessHoursWindow }
1407
1444
  tuesday { ...BusinessHoursWindow }
@@ -1412,6 +1449,7 @@ fragment BusinessHours on BusinessHours {
1412
1449
  sunday { ...BusinessHoursWindow }
1413
1450
  }
1414
1451
 
1452
+ # Physical store / pickup location — name, type (RETAIL / WAREHOUSE / PICKUP_POINT), address, business hours, pickup support flag + instructions, timezone. Spread on the store picker and location detail pages.
1415
1453
  fragment Location on Location {
1416
1454
  id
1417
1455
  name
@@ -1427,6 +1465,7 @@ fragment Location on Location {
1427
1465
  }
1428
1466
  }
1429
1467
 
1468
+ # Per-location stock entry for one variant — availability flag, stock quantity (token-gated), pickup time, full location detail. Spread inside `StoreAvailabilityConnection.edges[].node`.
1430
1469
  fragment StoreAvailability on StoreAvailability {
1431
1470
  isAvailable
1432
1471
  availableStock
@@ -1436,6 +1475,7 @@ fragment StoreAvailability on StoreAvailability {
1436
1475
  }
1437
1476
  }
1438
1477
 
1478
+ # Relay connection of `StoreAvailability` entries for a variant — used inside the `VariantStoreAvailability` fragment. Pre-paginated to 10 by default.
1439
1479
  fragment StoreAvailabilityConnection on StoreAvailabilityConnection {
1440
1480
  totalCount
1441
1481
  pageInfo {
@@ -1449,6 +1489,7 @@ fragment StoreAvailabilityConnection on StoreAvailabilityConnection {
1449
1489
  }
1450
1490
  }
1451
1491
 
1492
+ # Slim variant projection optimized for the store-picker UI — id, title, sku, isAvailable, total `availableStock` plus per-location `storeAvailability` connection. Use in `productStoreAvailability` query.
1452
1493
  fragment VariantStoreAvailability on ProductVariant {
1453
1494
  id
1454
1495
  title
@@ -1461,9 +1502,10 @@ fragment VariantStoreAvailability on ProductVariant {
1461
1502
  }
1462
1503
 
1463
1504
  # ============================================
1464
- # Content: Pages
1505
+ # Pages
1465
1506
  # ============================================
1466
1507
 
1508
+ # CMS page — handle (URL slug), title, body (HTML), excerpt, SEO metadata, publish date. Spread on About / Privacy / Terms / Returns Policy pages.
1467
1509
  fragment ShopPage on ShopPage {
1468
1510
  id
1469
1511
  handle
@@ -1480,9 +1522,10 @@ fragment ShopPage on ShopPage {
1480
1522
  }
1481
1523
 
1482
1524
  # ============================================
1483
- # Content: Navigation Menus
1525
+ # Navigation Menus
1484
1526
  # ============================================
1485
1527
 
1528
+ # One menu item with up to 3 levels of nested children — title, URL, type (`HTTP` / `FRONTPAGE` / `SEARCH` / `CATALOG` / `BLOG` / `PRODUCT` / `COLLECTION` / `CATEGORY` / `PAGE`), `resourceId` for typed items, optional image. Switch on `type` to render the right link target.
1486
1529
  fragment MenuItem on MenuItem {
1487
1530
  id
1488
1531
  title
@@ -1508,6 +1551,7 @@ fragment MenuItem on MenuItem {
1508
1551
  }
1509
1552
  }
1510
1553
 
1554
+ # Navigation menu — handle (e.g. "main-menu", "footer", "mobile"), title, nested item tree. Returned by `menu($handle)` query.
1511
1555
  fragment Menu on Menu {
1512
1556
  id
1513
1557
  handle
@@ -1518,24 +1562,20 @@ fragment Menu on Menu {
1518
1562
  }
1519
1563
 
1520
1564
  # ============================================
1521
- # Content: URL Redirects
1565
+ # URL Redirects
1522
1566
  # ============================================
1523
1567
 
1568
+ # Single legacy `path` → new `target` redirect entry. Use on the server / edge to issue 301 redirects for migrated routes.
1524
1569
  fragment UrlRedirect on UrlRedirect {
1525
1570
  path
1526
1571
  target
1527
1572
  }
1528
1573
 
1529
1574
  # ============================================
1530
- # Unified Product Configurator (Faza 1 + Faza 1.5 — Decision D-A v3 + D-I)
1575
+ # Product Configurator (per-product attributes)
1531
1576
  # ============================================
1532
- # Hybrid AttributeSet binding:
1533
- # - Product.attributes returns UNION of set definitions (via Product.attributeSetId)
1534
- # and per-product scoped definitions (AttributeDefinition.scopeProductId = product.id)
1535
- # - CUSTOMER fillingMode → rendered in storefront configurator UX
1536
- # - MERCHANT fillingMode → product metadata (filtering, display)
1537
- # - BOTH fillingMode → admin default + customer override in cart
1538
1577
 
1578
+ # Slim variant snapshot linked from a configurator option — when an attribute option (e.g. "256 GB" storage) maps to a specific variant, this fragment exposes that variant's id, title, sku, stock flags. Spread inside `ProductAttributeOption.linkedVariant`.
1539
1579
  fragment LinkedVariantSummary on LinkedVariantSummary {
1540
1580
  id
1541
1581
  productId
@@ -1546,6 +1586,7 @@ fragment LinkedVariantSummary on LinkedVariantSummary {
1546
1586
  trackQuantity
1547
1587
  }
1548
1588
 
1589
+ # One option (choice) within a configurator attribute — value, label, sort order, optional color hex, surcharge (amount + type), default flag, optional linked variant for variant-mapped options.
1549
1590
  fragment ProductAttributeOption on ProductAttributeOption {
1550
1591
  id
1551
1592
  value
@@ -1561,6 +1602,7 @@ fragment ProductAttributeOption on ProductAttributeOption {
1561
1602
  }
1562
1603
  }
1563
1604
 
1605
+ # Configurator attribute definition — name, type, fillingMode (CUSTOMER / MERCHANT / BOTH), billingMode, tax class, validation bounds, options (for choice-type attributes), required + visibility flags. Returned by `product.attributes(filter)` for the configurator UI.
1564
1606
  fragment ProductAttributeDefinition on ProductAttributeDefinition {
1565
1607
  id
1566
1608
  name