@doswiftly/storefront-operations 7.1.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/AGENTS.md CHANGED
@@ -27,10 +27,10 @@ consumer's `codegen.ts` references this package's `.graphql` files as
27
27
  live in the consumer's repo.
28
28
 
29
29
  <!-- AUTOGEN:STATS:BEGIN — auto-regenerated, do not edit by hand -->
30
- - **Schema version**: 7.1.0
30
+ - **Schema version**: 8.0.0
31
31
  - **Queries**: 48
32
32
  - **Mutations**: 44
33
- - **Fragments**: 108
33
+ - **Fragments**: 104
34
34
  <!-- AUTOGEN:STATS:END -->
35
35
 
36
36
  ## Loading order
package/CHANGELOG.md CHANGED
@@ -1,5 +1,78 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 5f016e2: **BREAKING**: Operations were renamed to match the underlying GraphQL schema field names. If you used codegen against this package, regenerate your hooks and update import paths.
8
+
9
+ ### Renamed checkout mutations
10
+
11
+ | Old operation name | New operation name | New field call |
12
+ | --------------------------------- | --------------------------------- | ---------------------------------------------------- |
13
+ | `CheckoutShippingAddressUpdate` | `CheckoutUpdateShippingAddress` | `checkoutUpdateShippingAddress(id, shippingAddress)` |
14
+ | `CheckoutBillingAddressUpdate` | `CheckoutUpdateBillingAddress` | `checkoutUpdateBillingAddress(id, billingAddress)` |
15
+ | `CheckoutEmailUpdate` | `CheckoutUpdateEmail` | `checkoutUpdateEmail(id, email)` |
16
+ | `CheckoutShippingLineUpdate` | `CheckoutSelectShippingRate` | `checkoutSelectShippingRate(id, rateId)` |
17
+ | `CheckoutDiscountCodeApply` | `CheckoutApplyDiscountCode` | `checkoutApplyDiscountCode(id, discountCode)` |
18
+ | `CheckoutDiscountCodeRemove` | `CheckoutRemoveDiscountCode` | `checkoutRemoveDiscountCode(id, discountCode)` |
19
+ | `CheckoutDiscountCodeValidate` | `CheckoutValidateDiscountCode` | `checkoutValidateDiscountCode(id, discountCode)` |
20
+ | `CheckoutPaymentMethodUpdate` | `CheckoutSelectPaymentMethod` | `checkoutSelectPaymentMethod(id, paymentMethodId)` |
21
+ | `CheckoutGiftCardApply` | `CheckoutApplyGiftCard` | `checkoutApplyGiftCard(id, giftCardCode)` |
22
+ | `CheckoutGiftCardRemove` | `CheckoutRemoveGiftCard` | `checkoutRemoveGiftCard(id, giftCardCode)` |
23
+ | `CheckoutGiftCardRecipientUpdate` | `CheckoutUpdateGiftCardRecipient` | `checkoutUpdateGiftCardRecipient(input)` |
24
+
25
+ ### Argument changes in checkout mutations
26
+ - Variable `$checkoutId: ID!` → `$id: ID!`
27
+ - Argument `checkoutId:` → `id:`
28
+ - In `CheckoutSelectShippingRate`: variable `$shippingRateHandle: String!` → `$rateId: String!`, argument `shippingRateHandle:` → `rateId:`
29
+
30
+ Note: `CheckoutCreate` and `CheckoutComplete` were already aligned and are unchanged.
31
+
32
+ ### Renamed queries
33
+
34
+ | Old query | New query | New field call |
35
+ | --------------------------------------- | ------------------- | --------------------------------- |
36
+ | `PredictiveSearch` (`predictiveSearch`) | `SearchSuggestions` | `searchSuggestions(query, limit)` |
37
+ | `AvailableFilters` (`availableFilters`) | `ProductFilters` | `productFilters(input)` |
38
+
39
+ `Categories` query now uses the `rootsOnly: true` argument and reads `nodes` instead of `roots`. Same data shape, standard Relay-style connection.
40
+
41
+ ### Renamed mutations (loyalty)
42
+
43
+ | Old mutation field | New mutation field |
44
+ | ---------------------- | ----------------------------- |
45
+ | `redeemLoyaltyReward` | `loyaltyRedeemReward` |
46
+ | `generateReferralCode` | `loyaltyGenerateReferralCode` |
47
+
48
+ Operation names (`RedeemLoyaltyReward`, `GenerateReferralCode`) are unchanged.
49
+
50
+ ### Wishlist mutations — argument alignment
51
+ - `wishlistAddItem(wishlistId, input)` → `wishlistAddItem(id, input)`
52
+ - `wishlistRemoveItem(wishlistId, itemId)` → `wishlistRemoveItem(id, itemId)`
53
+ - `wishlistDelete(wishlistId)` → `wishlistDelete(id)`
54
+
55
+ The `userErrors` field on every wishlist mutation result now correctly carries the `UserError` sub-selection.
56
+
57
+ ### Fragment shape changes
58
+ - `ProductCard` fragment now reads `categories { id, slug, name }` instead of the removed scalar `category` field. Cards that displayed a single category should now show the first item or join the list.
59
+ - `AvailableFilters` fragment now reads `activeCount` (was `activeFilterCount`) and `matchCount` (was `totalProducts`).
60
+ - Variant connections (`product.variants`) now require explicit `nodes { … }` selection — Relay-style.
61
+ - Loyalty payload fragments (`RedeemRewardPayload`, `GenerateReferralCodePayload`) now require the `UserError` sub-selection on `userErrors`.
62
+
63
+ ### Removed fragments
64
+ - `Price`, `PriceMoney`, `ProductRecommendation`, `CartRecommendation` — unused by any operation in this package. Inline equivalents are available if needed.
65
+
66
+ ### Migration
67
+ 1. Regenerate codegen output against the new `schema.graphql` and operation files.
68
+ 2. Update import paths to the new operation/hook names (search-and-replace based on the tables above).
69
+ 3. In your form/UI code, rename the mutation variable `checkoutId` → `id` and update the argument key in the request payload.
70
+ 4. In the shipping-rate flow, rename `shippingRateHandle` → `rateId`.
71
+ 5. In `ProductCard` consumers, switch from `product.category` (string) to the first item of `product.categories` (array of `{ id, slug, name }`).
72
+ 6. In `AvailableFilters` consumers, rename `activeFilterCount` → `activeCount` and `totalProducts` → `matchCount`.
73
+ 7. In any `variants` selection on a product, wrap field selections in `nodes { … }`.
74
+ 8. In `userErrors` reads on loyalty and wishlist mutations, expect the `UserError` shape (no longer a bare scalar).
75
+
3
76
  ## 7.1.0
4
77
 
5
78
  ### Minor Changes
package/README.md CHANGED
@@ -172,7 +172,7 @@ full executable body of each operation.
172
172
  | `ProductConfigurator` | Fetches a product together with its filtered attribute definitions, optimized for the configurator UI (e.g. customer-facing text fields, finishing options, scoped variants). `fillingMode: "CUSTOMER"` returns only customer-facing attributes; pass `"BOTH"` to also include attributes shared with the merchant admin. Single round-trip — saves a separate `attributes` query. |
173
173
  | `Products` | Paginated product list (Relay Connection, default page size 20, max 100). The `query` argument supports a structured search syntax — `tag:summer`, `vendor:foo`, `product_type:shirts`, `variants.price:>10`, plus `AND`/`OR`/`NOT` — falling back to free-text title/content search. The `filters[]` array uses multi-filter logic: same field name appears multiple times → OR; different fields → AND. Sort: `RELEVANCE`, `TITLE`, `PRICE`, `NEWEST`, `OLDEST`, `BEST_SELLING`. The response includes a `filters` block for faceted navigation (counts per filterable attribute value). |
174
174
  | `ProductSearch` | Full-text product search — `$query` is required. Functionally equivalent to `Products` with `$query` set, minus the `sortKey` argument (search defaults to relevance ranking). Use for the search results page; combine with `filters[]` for guided refinement. |
175
- | `PredictiveSearch` | Type-ahead suggestions for the storefront search input. Returns up to `$limit` matching products (hard cap 50) plus up to 5 styled query suggestions with `<mark>` tags around matched spans. Polish-language aware (handles morphology in suggestions). Run on each keystroke (debounce 200-300ms). The `$query` is capped at 100 characters server-side. |
175
+ | `SearchSuggestions` | Type-ahead suggestions for the storefront search input. Returns up to `$limit` matching products (hard cap 50) plus up to 5 styled query suggestions with `<mark>` tags around matched spans. Polish-language aware (handles morphology in suggestions). Run on each keystroke (debounce 200-300ms). The `$query` is capped at 100 characters server-side. |
176
176
 
177
177
  #### Collections
178
178
 
@@ -186,7 +186,7 @@ full executable body of each operation.
186
186
  | Operation | Description |
187
187
  | --- | --- |
188
188
  | `Category` | Fetches a single category by `id` or `slug` with its parent and immediate children. Use for breadcrumbs and sub-navigation. Nested queries on `parent` / `children` are batched server-side — safe to use in lists without N+1 concerns. |
189
- | `Categories` | Returns active categories for the shop. Each category exposes its `parent` and `children` — build the tree client-side by walking those fields (server batches the lookups, no N+1). The hierarchy is not depth-capped server-side. Use for nav mega-menus and category pages. |
189
+ | `Categories` | Returns active root categories for the shop. Each root exposes its `children` — build the tree client-side by walking those fields (server batches the lookups, no N+1). The hierarchy is not depth-capped server-side. Use for nav mega-menus and category pages. |
190
190
 
191
191
  #### Cart
192
192
 
@@ -246,7 +246,7 @@ full executable body of each operation.
246
246
 
247
247
  | Operation | Description |
248
248
  | --- | --- |
249
- | `AvailableFilters` | Returns the dynamic facet filters available for a listing context — pass `collectionId`, `categoryId`, or `searchQuery`. For each visible & filterable attribute, returns either discrete value counts (for `SELECT` / `CHECKBOX` types) or numeric range bounds (for `SLIDER` types). Plus `priceRange`, per-category counts, `activeCount` (length of `currentFilters` input), and `matchCount` (total products in the context). Use to render filter sidebars on listing/search pages. |
249
+ | `ProductFilters` | Returns the dynamic facet filters available for a listing context — pass `collectionId`, `categoryId`, or `searchQuery`. For each visible & filterable attribute, returns either discrete value counts (for `SELECT` / `CHECKBOX` types) or numeric range bounds (for `SLIDER` types). Plus `priceRange`, per-category counts, `activeCount` (length of `currentFilters` input), and `matchCount` (total products in the context). Use to render filter sidebars on listing/search pages. |
250
250
 
251
251
  #### Loyalty Program
252
252
 
@@ -374,23 +374,23 @@ full executable body of each operation.
374
374
  | Operation | Description |
375
375
  | --- | --- |
376
376
  | `CheckoutCreate` | Creates a new checkout session for the given cart (or a fresh cart if `cartId` is omitted). Inherits applied discounts and gift cards from the cart by reference (not snapshot). Errors: `CART_NOT_FOUND`, `EMPTY_CART`, `ALREADY_COMPLETED` (cart already converted to order). NOT idempotent — multiple calls create multiple checkouts. |
377
- | `CheckoutShippingAddressUpdate` | Sets the shipping address (full replace, not patch). Triggers cart re-pricing. Address format is NOT validated here — full validation runs at `checkoutComplete` (`validateOrderReadiness`). |
378
- | `CheckoutBillingAddressUpdate` | Sets the billing address (full replace). Independent of shipping address — pass it explicitly even when "billing same as shipping". |
379
- | `CheckoutEmailUpdate` | Sets or updates the contact email on the checkout (used for guest checkout, order confirmation, and tracking emails). Validated against a regex; returns `INVALID` for malformed format. |
380
- | `CheckoutShippingLineUpdate` | Selects a shipping method by `shippingRateHandle` (a stable shipping-method UUID, NOT an opaque per-request token). The id comes from `availableShippingMethods` query, computed for the current address + cart subtotal at request time. |
381
- | `CheckoutDiscountCodeApply` | Appends a discount code to the cart's `discount_codes` array. Note: while multiple codes can be stored, the pricing engine currently uses **only the first applied code** — codes do not stack. Validated for existence, active status, and customer usage limits via `discountService.validateDiscount`. |
382
- | `CheckoutDiscountCodeRemove` | Removes a code from the cart's `discount_codes` array (filters by exact match). Triggers re-pricing. |
383
- | `CheckoutDiscountCodeValidate` | READ-ONLY validation of a discount code against the current checkout — does NOT modify state. Returns `{ isValid, discount, error }` for previewing the effect (e.g. inline UI feedback as the user types). |
384
- | `CheckoutPaymentMethodUpdate` | Selects a payment method by `paymentMethodId` (UUID from `availablePaymentMethods` query). Validates existence and active status; no pre-authorization is performed here. |
385
- | `CheckoutComplete` | Finalizes the checkout: creates the `Order`, marks the cart `CONVERTED`, deducts gift cards, emits `ORDER_CREATED` (and `ORDER_CONFIRMED` for COD) — all in a single serializable transaction. **Idempotent on `idempotencyKey`** (NOT on `checkoutId`); auto-generated from `cartId + timestamp` if the caller omits it. The `paymentUrl` field is reserved but is NOT populated here — for hosted gateways (PayU, P24) the storefront calls a separate `paymentCreate` mutation after this returns. |
377
+ | `CheckoutUpdateShippingAddress` | Sets the shipping address (full replace, not patch). Triggers cart re-pricing. Address format is NOT validated here — full validation runs at `checkoutComplete`. |
378
+ | `CheckoutUpdateBillingAddress` | Sets the billing address (full replace). Independent of shipping address — pass it explicitly even when "billing same as shipping". |
379
+ | `CheckoutUpdateEmail` | Sets or updates the contact email on the checkout (used for guest checkout, order confirmation, and tracking emails). Validated against a regex; returns `INVALID` for malformed format. |
380
+ | `CheckoutSelectShippingRate` | Selects a shipping method by `rateId` (a stable shipping-method UUID, NOT an opaque per-request token). The id comes from `availableShippingMethods` query, computed for the current address + cart subtotal at request time. |
381
+ | `CheckoutApplyDiscountCode` | Appends a discount code to the cart's `discount_codes` array. Note: while multiple codes can be stored, the pricing engine currently uses **only the first applied code** — codes do not stack. Validated for existence, active status, and customer usage limits. |
382
+ | `CheckoutRemoveDiscountCode` | Removes a code from the cart's `discount_codes` array (filters by exact match). Triggers re-pricing. |
383
+ | `CheckoutValidateDiscountCode` | READ-ONLY validation of a discount code against the current checkout — does NOT modify state. Returns `{ isValid, discount, error }` for previewing the effect (e.g. inline UI feedback as the user types). |
384
+ | `CheckoutSelectPaymentMethod` | Selects a payment method by `paymentMethodId` (UUID from `availablePaymentMethods` query). Validates existence and active status; no pre-authorization is performed here. |
385
+ | `CheckoutComplete` | Finalizes the checkout: creates the `Order`, deducts gift cards, sends order-created confirmation — all atomically. **Idempotent on `idempotencyKey`** (NOT on the checkout `id`); auto-generated if the caller omits it. The `paymentUrl` field is reserved but is NOT populated here — for hosted gateways (PayU, P24) the storefront calls a separate `paymentCreate` mutation after this returns. |
386
386
 
387
387
  #### Gift Card Checkout Mutations
388
388
 
389
389
  | Operation | Description |
390
390
  | --- | --- |
391
- | `CheckoutGiftCardApply` | Applies a gift card to the cart, stackable with discount codes. Consumption is FIFO: each card consumes `min(remainingBalance, paymentDue)` against the current cart total in the order they were applied. The gift card balance is NOT debited yet — actual deduction happens atomically inside the `checkoutComplete` transaction. Errors: `GIFT_CARD_NOT_FOUND`, `GIFT_CARD_DEPLETED`, `GIFT_CARD_UNUSABLE`, `GIFT_CARD_ALREADY_APPLIED`. |
392
- | `CheckoutGiftCardRemove` | Removes a gift card from the applied list and recalculates FIFO `appliedAmount` for the remaining cards. Since gift card balances are only debited at `checkoutComplete`, removing before completion has no effect on the underlying gift card balance. |
393
- | `CheckoutGiftCardRecipientUpdate` | Sets per-line-item recipient details (name, email, message, delivery date) for digital gift card products in the cart (variants with `type: GIFT_CARD`). Required before `checkoutComplete` for any line item with a gift-card variant. Recipient details are associated with each gift-card line item and propagated to the resulting order. |
391
+ | `CheckoutApplyGiftCard` | Applies a gift card to the cart, stackable with discount codes. Consumption is FIFO: each card consumes `min(remainingBalance, paymentDue)` against the current cart total in the order they were applied. The gift card balance is NOT debited yet — actual deduction happens atomically at `checkoutComplete`. Errors: `GIFT_CARD_NOT_FOUND`, `GIFT_CARD_DEPLETED`, `GIFT_CARD_UNUSABLE`, `GIFT_CARD_ALREADY_APPLIED`. |
392
+ | `CheckoutRemoveGiftCard` | Removes a gift card from the applied list and recalculates FIFO `appliedAmount` for the remaining cards. Since gift card balances are only debited at `checkoutComplete`, removing before completion has no effect on the underlying gift card balance. |
393
+ | `CheckoutUpdateGiftCardRecipient` | Sets per-line-item recipient details (name, email, message, delivery date) for digital gift card products in the cart (variants with `type: GIFT_CARD`). Required before `checkoutComplete` for any line item with a gift-card variant. Recipient details are associated with each gift-card line item and propagated to the resulting order. |
394
394
 
395
395
  #### Return Mutations
396
396
 
@@ -419,9 +419,9 @@ full executable body of each operation.
419
419
  | Operation | Description |
420
420
  | --- | --- |
421
421
  | `WishlistCreate` | Creates a new wishlist for the logged-in customer. `name` is optional (defaults to "My Wishlist"); name uniqueness is NOT enforced — customers can have multiple lists with the same name. Setting `isPublic: true` generates a 16-byte hex `shareToken` for public sharing. |
422
- | `WishlistAddItem` | Adds an item by `productId` (and optional `variantId`) to a wishlist. Idempotent on the `(wishlist_id, product_id, variant_id)` unique constraint — adding an already-present item is a silent no-op (`ON CONFLICT DO NOTHING`). Captures `priceAtAdd` for price-drop notifications. |
422
+ | `WishlistAddItem` | Adds an item by `productId` (and optional `variantId`) to a wishlist. Idempotent on the `(wishlist_id, product_id, variant_id)` unique constraint — adding an already-present item is a silent no-op. Captures `priceAtAdd` for price-drop notifications. |
423
423
  | `WishlistRemoveItem` | Hard-deletes a wishlist item by `itemId` (the `WishlistItem` row id, NOT the product id). |
424
- | `WishlistDelete` | Hard-deletes the wishlist row. All `WishlistItem` rows are removed via FK cascade. No soft-delete; cannot be undone. |
424
+ | `WishlistDelete` | Hard-deletes the wishlist row. All wishlist items are removed via cascade. No soft-delete; cannot be undone. |
425
425
 
426
426
  #### Cart Attributes
427
427
 
@@ -445,8 +445,6 @@ full executable body of each operation.
445
445
  | `ImageCard` | `Image` | Card — product cards, collection / category tiles, blog post previews (rendered ~400px, transform delivers up to 800px for 2x DPI). Includes `thumbhash` placeholder. |
446
446
  | `ImageFull` | `Image` | Full — product detail gallery, hero banners (rendered ~800px, transform delivers up to 1600px for 2x DPI). Includes `thumbhash` placeholder. |
447
447
  | `Money` | `Money` | Plain `{ amount, currencyCode }` price. Use for `compareAtPrice`, totals, and any field where currency conversion transparency is not needed. `amount` is a String. |
448
- | `Price` | `PriceMoney` | Lightweight price for listing views (cards, grids, search results) — same shape as `Money`. Spread when full conversion metadata is overkill. |
449
- | `PriceMoney` | `PriceMoney` | Full price with currency-conversion transparency — adds `baseAmount`, `baseCurrencyCode`, `exchangeRate`, `marginApplied`, `rateTimestamp`, `isConverted`. Spread on PDP / cart / checkout where the customer needs to see the original price + applied conversion. |
450
448
  | `SelectedOption` | `SelectedOption` | Selected variant option (e.g. `{ name: "Color", value: "Red" }`) on a `ProductVariant`. Use to render variant labels in cart / order summaries. |
451
449
 
452
450
  #### Products
@@ -517,7 +515,7 @@ full executable body of each operation.
517
515
 
518
516
  | Fragment | On Type | Description |
519
517
  | --- | --- | --- |
520
- | `ShippingRate` | `ShippingRate` | Single shipping rate option — `handle` is the stable id you pass to `checkoutShippingLineUpdate`, plus title and price. |
518
+ | `ShippingRate` | `ShippingRate` | Single shipping rate option — `handle` is the stable id you pass to `checkoutSelectShippingRate` as `rateId`, plus title and price. |
521
519
  | `TaxLine` | `TaxLine` | One tax line on the checkout — title, rate (decimal, e.g. 0.23 for 23%), computed amount. Spread on the order summary. |
522
520
  | `DiscountAffectedItem` | `DiscountAffectedItem` | 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. |
523
521
  | `DiscountApplication` | `DiscountApplication` | 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. |
@@ -573,7 +571,7 @@ full executable body of each operation.
573
571
  | `AttributeDefinition` | `AttributeDefinition` | 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[]`. |
574
572
  | `PriceRangeFilter` | `PriceRange` | Min / max price range across products in the current listing context. Use to bound the price slider. |
575
573
  | `CategoryFilterOption` | `CategoryFilterOption` | 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. |
576
- | `AvailableFilters` | `AvailableFilters` | Full result of the `availableFilters($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. |
574
+ | `AvailableFilters` | `AvailableFilters` | 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. |
577
575
 
578
576
  #### Loyalty Program
579
577
 
@@ -590,8 +588,8 @@ full executable body of each operation.
590
588
  | `LoyaltyAction` | `LoyaltyAction` | One earn action configured in the loyalty program — type (`PURCHASE` / `SIGNUP` / `REFERRAL` / `REVIEW` / `BIRTHDAY`), enabled flag, points granted. |
591
589
  | `LoyaltySettings` | `LoyaltySettings` | 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`. |
592
590
  | `ReferralStats` | `ReferralStats` | Customer referral statistics — code, share URL, counts of referred / completed / pending, lifetime points earned. Returned by `referralStats`. |
593
- | `RedeemRewardPayload` | `RedeemRewardPayload` | Result of `redeemLoyaltyReward` — depending on the reward type, exactly one of `discountCode`, `productDiscountCode`, `giftCardCode` is populated. Apply the returned code on cart/checkout. |
594
- | `GenerateReferralCodePayload` | `GenerateReferralCodePayload` | Result of `generateReferralCode` — the customer's referral code and shareable URL. |
591
+ | `RedeemRewardPayload` | `RedeemRewardPayload` | Result of `loyaltyRedeemReward` — depending on the reward type, exactly one of `discountCode`, `productDiscountCode`, `giftCardCode` is populated. Apply the returned code on cart/checkout. |
592
+ | `GenerateReferralCodePayload` | `GenerateReferralCodePayload` | Result of `loyaltyGenerateReferralCode` — the customer's referral code and shareable URL. |
595
593
 
596
594
  #### Reviews
597
595
 
@@ -615,13 +613,6 @@ full executable body of each operation.
615
613
  | `BlogTag` | `BlogTag` | Blog tag — name, slug, post count. Spread on tag clouds and post tag labels. |
616
614
  | `BlogPost` | `BlogPost` | 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. |
617
615
 
618
- #### Recommendations
619
-
620
- | Fragment | On Type | Description |
621
- | --- | --- | --- |
622
- | `ProductRecommendation` | `ProductRecommendation` | One recommended product — the product itself (card-level), recommendation type (e.g. SIMILAR / FREQUENTLY_BOUGHT_TOGETHER), score (0-100), human reason text. Spread on PDP "You may also like" sections. |
623
- | `CartRecommendation` | `CartRecommendations` | Recommendations bundle for the cart drawer — `frequentlyBoughtTogether` (cross-sell) and `youMayAlsoLike` (related). Each entry has the same shape as `ProductRecommendation`. |
624
-
625
616
  #### Store Availability (BOPIS / multi-location)
626
617
 
627
618
  | Fragment | On Type | Description |
package/fragments.graphql CHANGED
@@ -74,23 +74,6 @@ fragment Money on Money {
74
74
  currencyCode
75
75
  }
76
76
 
77
- # Lightweight price for listing views (cards, grids, search results) — same shape as `Money`. Spread when full conversion metadata is overkill.
78
- fragment Price on PriceMoney {
79
- amount
80
- currencyCode
81
- }
82
-
83
- # Full price with currency-conversion transparency — adds `baseAmount`, `baseCurrencyCode`, `exchangeRate`, `marginApplied`, `rateTimestamp`, `isConverted`. Spread on PDP / cart / checkout where the customer needs to see the original price + applied conversion.
84
- fragment PriceMoney on PriceMoney {
85
- ...Price
86
- baseAmount
87
- baseCurrencyCode
88
- exchangeRate
89
- marginApplied
90
- rateTimestamp
91
- isConverted
92
- }
93
-
94
77
  # Selected variant option (e.g. `{ name: "Color", value: "Red" }`) on a `ProductVariant`. Use to render variant labels in cart / order summaries.
95
78
  fragment SelectedOption on SelectedOption {
96
79
  name
@@ -134,7 +117,11 @@ fragment ProductCard on Product {
134
117
  handle
135
118
  title
136
119
  vendor
137
- category
120
+ categories {
121
+ id
122
+ slug
123
+ name
124
+ }
138
125
  isAvailable
139
126
  averageRating
140
127
  reviewCount
@@ -635,7 +622,7 @@ fragment AvailablePaymentMethods on AvailablePaymentMethods {
635
622
  # Checkout
636
623
  # ============================================
637
624
 
638
- # Single shipping rate option — `handle` is the stable id you pass to `checkoutShippingLineUpdate`, plus title and price.
625
+ # Single shipping rate option — `handle` is the stable id you pass to `checkoutSelectShippingRate` as `rateId`, plus title and price.
639
626
  fragment ShippingRate on ShippingRate {
640
627
  handle
641
628
  title
@@ -1106,7 +1093,7 @@ fragment CategoryFilterOption on CategoryFilterOption {
1106
1093
  parentId
1107
1094
  }
1108
1095
 
1109
- # Full result of the `availableFilters($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.
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.
1110
1097
  fragment AvailableFilters on AvailableFilters {
1111
1098
  attributes {
1112
1099
  ...AttributeDefinition
@@ -1117,8 +1104,8 @@ fragment AvailableFilters on AvailableFilters {
1117
1104
  categories {
1118
1105
  ...CategoryFilterOption
1119
1106
  }
1120
- activeFilterCount
1121
- totalProducts
1107
+ activeCount
1108
+ matchCount
1122
1109
  }
1123
1110
 
1124
1111
  # ============================================
@@ -1269,21 +1256,25 @@ fragment ReferralStats on ReferralStats {
1269
1256
  totalPointsEarned
1270
1257
  }
1271
1258
 
1272
- # Result of `redeemLoyaltyReward` — depending on the reward type, exactly one of `discountCode`, `productDiscountCode`, `giftCardCode` is populated. Apply the returned code on cart/checkout.
1259
+ # Result of `loyaltyRedeemReward` — depending on the reward type, exactly one of `discountCode`, `productDiscountCode`, `giftCardCode` is populated. Apply the returned code on cart/checkout.
1273
1260
  fragment RedeemRewardPayload on RedeemRewardPayload {
1274
1261
  success
1275
1262
  discountCode
1276
1263
  productDiscountCode
1277
1264
  giftCardCode
1278
- userErrors
1265
+ userErrors {
1266
+ ...UserError
1267
+ }
1279
1268
  }
1280
1269
 
1281
- # Result of `generateReferralCode` — the customer's referral code and shareable URL.
1270
+ # Result of `loyaltyGenerateReferralCode` — the customer's referral code and shareable URL.
1282
1271
  fragment GenerateReferralCodePayload on GenerateReferralCodePayload {
1283
1272
  success
1284
1273
  referralCode
1285
1274
  shareUrl
1286
- userErrors
1275
+ userErrors {
1276
+ ...UserError
1277
+ }
1287
1278
  }
1288
1279
 
1289
1280
  # ============================================
@@ -1415,39 +1406,6 @@ fragment BlogPost on BlogPost {
1415
1406
  updatedAt
1416
1407
  }
1417
1408
 
1418
- # ============================================
1419
- # Recommendations
1420
- # ============================================
1421
-
1422
- # One recommended product — the product itself (card-level), recommendation type (e.g. SIMILAR / FREQUENTLY_BOUGHT_TOGETHER), score (0-100), human reason text. Spread on PDP "You may also like" sections.
1423
- fragment ProductRecommendation on ProductRecommendation {
1424
- product {
1425
- ...ProductCard
1426
- }
1427
- type
1428
- score
1429
- reason
1430
- }
1431
-
1432
- # Recommendations bundle for the cart drawer — `frequentlyBoughtTogether` (cross-sell) and `youMayAlsoLike` (related). Each entry has the same shape as `ProductRecommendation`.
1433
- fragment CartRecommendation on CartRecommendations {
1434
- frequentlyBoughtTogether {
1435
- product {
1436
- ...ProductCard
1437
- }
1438
- type
1439
- score
1440
- reason
1441
- }
1442
- youMayAlsoLike {
1443
- product {
1444
- ...ProductCard
1445
- }
1446
- type
1447
- score
1448
- reason
1449
- }
1450
- }
1451
1409
 
1452
1410
  # ============================================
1453
1411
  # Store Availability (BOPIS / multi-location)