@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/operations.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "schemaVersion": "7.1.0",
2
+ "schemaVersion": "8.0.0",
3
3
  "queries": [
4
4
  {
5
5
  "name": "Shop",
@@ -47,15 +47,15 @@
47
47
  },
48
48
  {
49
49
  "name": "fillingMode",
50
- "type": "String",
51
- "defaultValue": "\"CUSTOMER\""
50
+ "type": "AttributeFillingMode",
51
+ "defaultValue": "CUSTOMER"
52
52
  }
53
53
  ],
54
54
  "fragmentRefs": [
55
55
  "ProductAttributeDefinition",
56
56
  "ProductFull"
57
57
  ],
58
- "body": "query ProductConfigurator($handle: String!, $fillingMode: String = \"CUSTOMER\") {\n product(handle: $handle) {\n ...ProductFull\n attributes(filter: {fillingMode: $fillingMode}) {\n ...ProductAttributeDefinition\n }\n }\n}"
58
+ "body": "query ProductConfigurator($handle: String!, $fillingMode: AttributeFillingMode = CUSTOMER) {\n product(handle: $handle) {\n ...ProductFull\n attributes(filter: {fillingMode: $fillingMode}) {\n ...ProductAttributeDefinition\n }\n }\n}"
59
59
  },
60
60
  {
61
61
  "name": "Products",
@@ -134,7 +134,7 @@
134
134
  "body": "query ProductSearch($query: String!, $first: Int = 20, $after: String, $filters: [ProductFilter!]) {\n products(query: $query, first: $first, after: $after, filters: $filters) {\n edges {\n node {\n ...ProductCard\n }\n cursor\n }\n nodes {\n ...ProductCard\n }\n pageInfo {\n ...PageInfo\n }\n totalCount\n }\n}"
135
135
  },
136
136
  {
137
- "name": "PredictiveSearch",
137
+ "name": "SearchSuggestions",
138
138
  "kind": "query",
139
139
  "section": "Products",
140
140
  "description": "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.",
@@ -153,7 +153,7 @@
153
153
  "fragmentRefs": [
154
154
  "ProductCard"
155
155
  ],
156
- "body": "query PredictiveSearch($query: String!, $limit: Int = 10) {\n predictiveSearch(query: $query, limit: $limit) {\n products {\n ...ProductCard\n }\n queries {\n text\n styledText\n }\n }\n}"
156
+ "body": "query SearchSuggestions($query: String!, $limit: Int = 10) {\n searchSuggestions(query: $query, limit: $limit) {\n products {\n ...ProductCard\n }\n queries {\n text\n styledText\n }\n }\n}"
157
157
  },
158
158
  {
159
159
  "name": "Collection",
@@ -258,12 +258,12 @@
258
258
  "name": "Categories",
259
259
  "kind": "query",
260
260
  "section": "Categories",
261
- "description": "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.",
261
+ "description": "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.",
262
262
  "variables": [],
263
263
  "fragmentRefs": [
264
264
  "Category"
265
265
  ],
266
- "body": "query Categories {\n categories {\n roots {\n ...Category\n children {\n ...Category\n children {\n ...Category\n }\n }\n }\n totalCount\n }\n}"
266
+ "body": "query Categories {\n categories(rootsOnly: true) {\n nodes {\n ...Category\n children {\n ...Category\n children {\n ...Category\n }\n }\n }\n totalCount\n }\n}"
267
267
  },
268
268
  {
269
269
  "name": "Cart",
@@ -500,7 +500,7 @@
500
500
  "body": "query AvailableShippingMethods($address: ShippingAddressInput!, $cart: CartShippingInput) {\n availableShippingMethods(address: $address, cart: $cart) {\n methods {\n ...AvailableShippingMethod\n }\n freeShippingProgress {\n ...FreeShippingProgress\n }\n userErrors {\n ...UserError\n }\n }\n}"
501
501
  },
502
502
  {
503
- "name": "AvailableFilters",
503
+ "name": "ProductFilters",
504
504
  "kind": "query",
505
505
  "section": "Attribute Filters",
506
506
  "description": "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.",
@@ -514,7 +514,7 @@
514
514
  "fragmentRefs": [
515
515
  "AvailableFilters"
516
516
  ],
517
- "body": "query AvailableFilters($input: AvailableFiltersInput) {\n availableFilters(input: $input) {\n ...AvailableFilters\n }\n}"
517
+ "body": "query ProductFilters($input: AvailableFiltersInput) {\n productFilters(input: $input) {\n ...AvailableFilters\n }\n}"
518
518
  },
519
519
  {
520
520
  "name": "LoyaltyMember",
@@ -944,7 +944,7 @@
944
944
  "fragmentRefs": [
945
945
  "VariantStoreAvailability"
946
946
  ],
947
- "body": "query ProductStoreAvailability($handle: String, $id: ID) {\n product(handle: $handle, id: $id) {\n id\n handle\n title\n variants {\n ...VariantStoreAvailability\n }\n }\n}"
947
+ "body": "query ProductStoreAvailability($handle: String, $id: ID) {\n product(handle: $handle, id: $id) {\n id\n handle\n title\n variants {\n nodes {\n ...VariantStoreAvailability\n }\n }\n }\n}"
948
948
  },
949
949
  {
950
950
  "name": "Locations",
@@ -1404,13 +1404,13 @@
1404
1404
  "body": "mutation CheckoutCreate($input: CheckoutCreateInput!) {\n checkoutCreate(input: $input) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1405
1405
  },
1406
1406
  {
1407
- "name": "CheckoutShippingAddressUpdate",
1407
+ "name": "CheckoutUpdateShippingAddress",
1408
1408
  "kind": "mutation",
1409
1409
  "section": "Checkout Mutations",
1410
- "description": "Sets the shipping address (full replace, not patch). Triggers cart re-pricing. Address format is NOT validated here — full validation runs at `checkoutComplete` (`validateOrderReadiness`).",
1410
+ "description": "Sets the shipping address (full replace, not patch). Triggers cart re-pricing. Address format is NOT validated here — full validation runs at `checkoutComplete`.",
1411
1411
  "variables": [
1412
1412
  {
1413
- "name": "checkoutId",
1413
+ "name": "id",
1414
1414
  "type": "ID!",
1415
1415
  "defaultValue": null
1416
1416
  },
@@ -1424,16 +1424,16 @@
1424
1424
  "Checkout",
1425
1425
  "UserError"
1426
1426
  ],
1427
- "body": "mutation CheckoutShippingAddressUpdate($checkoutId: ID!, $shippingAddress: CheckoutAddressInput!) {\n checkoutShippingAddressUpdate(\n checkoutId: $checkoutId\n shippingAddress: $shippingAddress\n ) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1427
+ "body": "mutation CheckoutUpdateShippingAddress($id: ID!, $shippingAddress: CheckoutAddressInput!) {\n checkoutUpdateShippingAddress(id: $id, shippingAddress: $shippingAddress) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1428
1428
  },
1429
1429
  {
1430
- "name": "CheckoutBillingAddressUpdate",
1430
+ "name": "CheckoutUpdateBillingAddress",
1431
1431
  "kind": "mutation",
1432
1432
  "section": "Checkout Mutations",
1433
1433
  "description": "Sets the billing address (full replace). Independent of shipping address — pass it explicitly even when \"billing same as shipping\".",
1434
1434
  "variables": [
1435
1435
  {
1436
- "name": "checkoutId",
1436
+ "name": "id",
1437
1437
  "type": "ID!",
1438
1438
  "defaultValue": null
1439
1439
  },
@@ -1447,16 +1447,16 @@
1447
1447
  "Checkout",
1448
1448
  "UserError"
1449
1449
  ],
1450
- "body": "mutation CheckoutBillingAddressUpdate($checkoutId: ID!, $billingAddress: CheckoutAddressInput!) {\n checkoutBillingAddressUpdate(\n checkoutId: $checkoutId\n billingAddress: $billingAddress\n ) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1450
+ "body": "mutation CheckoutUpdateBillingAddress($id: ID!, $billingAddress: CheckoutAddressInput!) {\n checkoutUpdateBillingAddress(id: $id, billingAddress: $billingAddress) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1451
1451
  },
1452
1452
  {
1453
- "name": "CheckoutEmailUpdate",
1453
+ "name": "CheckoutUpdateEmail",
1454
1454
  "kind": "mutation",
1455
1455
  "section": "Checkout Mutations",
1456
1456
  "description": "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.",
1457
1457
  "variables": [
1458
1458
  {
1459
- "name": "checkoutId",
1459
+ "name": "id",
1460
1460
  "type": "ID!",
1461
1461
  "defaultValue": null
1462
1462
  },
@@ -1470,21 +1470,21 @@
1470
1470
  "Checkout",
1471
1471
  "UserError"
1472
1472
  ],
1473
- "body": "mutation CheckoutEmailUpdate($checkoutId: ID!, $email: String!) {\n checkoutEmailUpdate(checkoutId: $checkoutId, email: $email) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1473
+ "body": "mutation CheckoutUpdateEmail($id: ID!, $email: String!) {\n checkoutUpdateEmail(id: $id, email: $email) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1474
1474
  },
1475
1475
  {
1476
- "name": "CheckoutShippingLineUpdate",
1476
+ "name": "CheckoutSelectShippingRate",
1477
1477
  "kind": "mutation",
1478
1478
  "section": "Checkout Mutations",
1479
- "description": "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.",
1479
+ "description": "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.",
1480
1480
  "variables": [
1481
1481
  {
1482
- "name": "checkoutId",
1482
+ "name": "id",
1483
1483
  "type": "ID!",
1484
1484
  "defaultValue": null
1485
1485
  },
1486
1486
  {
1487
- "name": "shippingRateHandle",
1487
+ "name": "rateId",
1488
1488
  "type": "String!",
1489
1489
  "defaultValue": null
1490
1490
  }
@@ -1493,16 +1493,16 @@
1493
1493
  "Checkout",
1494
1494
  "UserError"
1495
1495
  ],
1496
- "body": "mutation CheckoutShippingLineUpdate($checkoutId: ID!, $shippingRateHandle: String!) {\n checkoutShippingLineUpdate(\n checkoutId: $checkoutId\n shippingRateHandle: $shippingRateHandle\n ) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1496
+ "body": "mutation CheckoutSelectShippingRate($id: ID!, $rateId: String!) {\n checkoutSelectShippingRate(id: $id, rateId: $rateId) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1497
1497
  },
1498
1498
  {
1499
- "name": "CheckoutDiscountCodeApply",
1499
+ "name": "CheckoutApplyDiscountCode",
1500
1500
  "kind": "mutation",
1501
1501
  "section": "Checkout Mutations",
1502
- "description": "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`.",
1502
+ "description": "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.",
1503
1503
  "variables": [
1504
1504
  {
1505
- "name": "checkoutId",
1505
+ "name": "id",
1506
1506
  "type": "ID!",
1507
1507
  "defaultValue": null
1508
1508
  },
@@ -1516,16 +1516,16 @@
1516
1516
  "Checkout",
1517
1517
  "UserError"
1518
1518
  ],
1519
- "body": "mutation CheckoutDiscountCodeApply($checkoutId: ID!, $discountCode: String!) {\n checkoutDiscountCodeApply(checkoutId: $checkoutId, discountCode: $discountCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1519
+ "body": "mutation CheckoutApplyDiscountCode($id: ID!, $discountCode: String!) {\n checkoutApplyDiscountCode(id: $id, discountCode: $discountCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1520
1520
  },
1521
1521
  {
1522
- "name": "CheckoutDiscountCodeRemove",
1522
+ "name": "CheckoutRemoveDiscountCode",
1523
1523
  "kind": "mutation",
1524
1524
  "section": "Checkout Mutations",
1525
1525
  "description": "Removes a code from the cart's `discount_codes` array (filters by exact match). Triggers re-pricing.",
1526
1526
  "variables": [
1527
1527
  {
1528
- "name": "checkoutId",
1528
+ "name": "id",
1529
1529
  "type": "ID!",
1530
1530
  "defaultValue": null
1531
1531
  },
@@ -1539,16 +1539,16 @@
1539
1539
  "Checkout",
1540
1540
  "UserError"
1541
1541
  ],
1542
- "body": "mutation CheckoutDiscountCodeRemove($checkoutId: ID!, $discountCode: String!) {\n checkoutDiscountCodeRemove(checkoutId: $checkoutId, discountCode: $discountCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1542
+ "body": "mutation CheckoutRemoveDiscountCode($id: ID!, $discountCode: String!) {\n checkoutRemoveDiscountCode(id: $id, discountCode: $discountCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1543
1543
  },
1544
1544
  {
1545
- "name": "CheckoutDiscountCodeValidate",
1545
+ "name": "CheckoutValidateDiscountCode",
1546
1546
  "kind": "mutation",
1547
1547
  "section": "Checkout Mutations",
1548
1548
  "description": "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).",
1549
1549
  "variables": [
1550
1550
  {
1551
- "name": "checkoutId",
1551
+ "name": "id",
1552
1552
  "type": "ID!",
1553
1553
  "defaultValue": null
1554
1554
  },
@@ -1561,16 +1561,16 @@
1561
1561
  "fragmentRefs": [
1562
1562
  "UserError"
1563
1563
  ],
1564
- "body": "mutation CheckoutDiscountCodeValidate($checkoutId: ID!, $discountCode: String!) {\n checkoutDiscountCodeValidate(\n checkoutId: $checkoutId\n discountCode: $discountCode\n ) {\n result {\n isValid\n discount {\n code\n title\n type\n value\n discountAmount {\n amount\n currencyCode\n }\n }\n error {\n code\n message\n }\n }\n userErrors {\n ...UserError\n }\n }\n}"
1564
+ "body": "mutation CheckoutValidateDiscountCode($id: ID!, $discountCode: String!) {\n checkoutValidateDiscountCode(id: $id, discountCode: $discountCode) {\n result {\n isValid\n discount {\n code\n title\n type\n value\n discountAmount {\n amount\n currencyCode\n }\n }\n error {\n code\n message\n }\n }\n userErrors {\n ...UserError\n }\n }\n}"
1565
1565
  },
1566
1566
  {
1567
- "name": "CheckoutPaymentMethodUpdate",
1567
+ "name": "CheckoutSelectPaymentMethod",
1568
1568
  "kind": "mutation",
1569
1569
  "section": "Checkout Mutations",
1570
1570
  "description": "Selects a payment method by `paymentMethodId` (UUID from `availablePaymentMethods` query). Validates existence and active status; no pre-authorization is performed here.",
1571
1571
  "variables": [
1572
1572
  {
1573
- "name": "checkoutId",
1573
+ "name": "id",
1574
1574
  "type": "ID!",
1575
1575
  "defaultValue": null
1576
1576
  },
@@ -1584,16 +1584,16 @@
1584
1584
  "Checkout",
1585
1585
  "UserError"
1586
1586
  ],
1587
- "body": "mutation CheckoutPaymentMethodUpdate($checkoutId: ID!, $paymentMethodId: ID!) {\n checkoutPaymentMethodUpdate(\n checkoutId: $checkoutId\n paymentMethodId: $paymentMethodId\n ) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1587
+ "body": "mutation CheckoutSelectPaymentMethod($id: ID!, $paymentMethodId: ID!) {\n checkoutSelectPaymentMethod(id: $id, paymentMethodId: $paymentMethodId) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1588
1588
  },
1589
1589
  {
1590
1590
  "name": "CheckoutComplete",
1591
1591
  "kind": "mutation",
1592
1592
  "section": "Checkout Mutations",
1593
- "description": "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.",
1593
+ "description": "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.",
1594
1594
  "variables": [
1595
1595
  {
1596
- "name": "checkoutId",
1596
+ "name": "id",
1597
1597
  "type": "ID!",
1598
1598
  "defaultValue": null
1599
1599
  },
@@ -1608,16 +1608,16 @@
1608
1608
  "Order",
1609
1609
  "UserError"
1610
1610
  ],
1611
- "body": "mutation CheckoutComplete($checkoutId: ID!, $input: CheckoutCompleteInput) {\n checkoutComplete(checkoutId: $checkoutId, input: $input) {\n checkout {\n ...Checkout\n }\n order {\n ...Order\n }\n paymentUrl\n userErrors {\n ...UserError\n }\n }\n}"
1611
+ "body": "mutation CheckoutComplete($id: ID!, $input: CheckoutCompleteInput) {\n checkoutComplete(id: $id, input: $input) {\n checkout {\n ...Checkout\n }\n order {\n ...Order\n }\n paymentUrl\n userErrors {\n ...UserError\n }\n }\n}"
1612
1612
  },
1613
1613
  {
1614
- "name": "CheckoutGiftCardApply",
1614
+ "name": "CheckoutApplyGiftCard",
1615
1615
  "kind": "mutation",
1616
1616
  "section": "Gift Card Checkout Mutations",
1617
- "description": "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`.",
1617
+ "description": "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`.",
1618
1618
  "variables": [
1619
1619
  {
1620
- "name": "checkoutId",
1620
+ "name": "id",
1621
1621
  "type": "ID!",
1622
1622
  "defaultValue": null
1623
1623
  },
@@ -1631,16 +1631,16 @@
1631
1631
  "Checkout",
1632
1632
  "UserError"
1633
1633
  ],
1634
- "body": "mutation CheckoutGiftCardApply($checkoutId: ID!, $giftCardCode: String!) {\n checkoutGiftCardApply(checkoutId: $checkoutId, giftCardCode: $giftCardCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1634
+ "body": "mutation CheckoutApplyGiftCard($id: ID!, $giftCardCode: String!) {\n checkoutApplyGiftCard(id: $id, giftCardCode: $giftCardCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1635
1635
  },
1636
1636
  {
1637
- "name": "CheckoutGiftCardRemove",
1637
+ "name": "CheckoutRemoveGiftCard",
1638
1638
  "kind": "mutation",
1639
1639
  "section": "Gift Card Checkout Mutations",
1640
1640
  "description": "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.",
1641
1641
  "variables": [
1642
1642
  {
1643
- "name": "checkoutId",
1643
+ "name": "id",
1644
1644
  "type": "ID!",
1645
1645
  "defaultValue": null
1646
1646
  },
@@ -1654,10 +1654,10 @@
1654
1654
  "Checkout",
1655
1655
  "UserError"
1656
1656
  ],
1657
- "body": "mutation CheckoutGiftCardRemove($checkoutId: ID!, $giftCardCode: String!) {\n checkoutGiftCardRemove(checkoutId: $checkoutId, giftCardCode: $giftCardCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1657
+ "body": "mutation CheckoutRemoveGiftCard($id: ID!, $giftCardCode: String!) {\n checkoutRemoveGiftCard(id: $id, giftCardCode: $giftCardCode) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1658
1658
  },
1659
1659
  {
1660
- "name": "CheckoutGiftCardRecipientUpdate",
1660
+ "name": "CheckoutUpdateGiftCardRecipient",
1661
1661
  "kind": "mutation",
1662
1662
  "section": "Gift Card Checkout Mutations",
1663
1663
  "description": "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.",
@@ -1672,7 +1672,7 @@
1672
1672
  "Checkout",
1673
1673
  "UserError"
1674
1674
  ],
1675
- "body": "mutation CheckoutGiftCardRecipientUpdate($input: CheckoutGiftCardRecipientInput!) {\n checkoutGiftCardRecipientUpdate(input: $input) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1675
+ "body": "mutation CheckoutUpdateGiftCardRecipient($input: CheckoutGiftCardRecipientInput!) {\n checkoutUpdateGiftCardRecipient(input: $input) {\n checkout {\n ...Checkout\n }\n userErrors {\n ...UserError\n }\n }\n}"
1676
1676
  },
1677
1677
  {
1678
1678
  "name": "ReturnCreate",
@@ -1725,7 +1725,7 @@
1725
1725
  "fragmentRefs": [
1726
1726
  "RedeemRewardPayload"
1727
1727
  ],
1728
- "body": "mutation RedeemLoyaltyReward($input: RedeemRewardInput!) {\n redeemLoyaltyReward(input: $input) {\n ...RedeemRewardPayload\n }\n}"
1728
+ "body": "mutation RedeemLoyaltyReward($input: RedeemRewardInput!) {\n loyaltyRedeemReward(input: $input) {\n ...RedeemRewardPayload\n }\n}"
1729
1729
  },
1730
1730
  {
1731
1731
  "name": "GenerateReferralCode",
@@ -1736,7 +1736,7 @@
1736
1736
  "fragmentRefs": [
1737
1737
  "GenerateReferralCodePayload"
1738
1738
  ],
1739
- "body": "mutation GenerateReferralCode {\n generateReferralCode {\n ...GenerateReferralCodePayload\n }\n}"
1739
+ "body": "mutation GenerateReferralCode {\n loyaltyGenerateReferralCode {\n ...GenerateReferralCodePayload\n }\n}"
1740
1740
  },
1741
1741
  {
1742
1742
  "name": "ReviewCreate",
@@ -1805,18 +1805,19 @@
1805
1805
  }
1806
1806
  ],
1807
1807
  "fragmentRefs": [
1808
+ "UserError",
1808
1809
  "Wishlist"
1809
1810
  ],
1810
- "body": "mutation WishlistCreate($input: WishlistCreateInput!) {\n wishlistCreate(input: $input) {\n wishlist {\n ...Wishlist\n }\n userErrors\n }\n}"
1811
+ "body": "mutation WishlistCreate($input: WishlistCreateInput!) {\n wishlistCreate(input: $input) {\n wishlist {\n ...Wishlist\n }\n userErrors {\n ...UserError\n }\n }\n}"
1811
1812
  },
1812
1813
  {
1813
1814
  "name": "WishlistAddItem",
1814
1815
  "kind": "mutation",
1815
1816
  "section": "Wishlist Mutations",
1816
- "description": "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.",
1817
+ "description": "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.",
1817
1818
  "variables": [
1818
1819
  {
1819
- "name": "wishlistId",
1820
+ "name": "id",
1820
1821
  "type": "ID!",
1821
1822
  "defaultValue": null
1822
1823
  },
@@ -1827,9 +1828,10 @@
1827
1828
  }
1828
1829
  ],
1829
1830
  "fragmentRefs": [
1831
+ "UserError",
1830
1832
  "Wishlist"
1831
1833
  ],
1832
- "body": "mutation WishlistAddItem($wishlistId: ID!, $input: WishlistItemInput!) {\n wishlistAddItem(wishlistId: $wishlistId, input: $input) {\n wishlist {\n ...Wishlist\n }\n userErrors\n }\n}"
1834
+ "body": "mutation WishlistAddItem($id: ID!, $input: WishlistItemInput!) {\n wishlistAddItem(id: $id, input: $input) {\n wishlist {\n ...Wishlist\n }\n userErrors {\n ...UserError\n }\n }\n}"
1833
1835
  },
1834
1836
  {
1835
1837
  "name": "WishlistRemoveItem",
@@ -1838,7 +1840,7 @@
1838
1840
  "description": "Hard-deletes a wishlist item by `itemId` (the `WishlistItem` row id, NOT the product id).",
1839
1841
  "variables": [
1840
1842
  {
1841
- "name": "wishlistId",
1843
+ "name": "id",
1842
1844
  "type": "ID!",
1843
1845
  "defaultValue": null
1844
1846
  },
@@ -1849,26 +1851,28 @@
1849
1851
  }
1850
1852
  ],
1851
1853
  "fragmentRefs": [
1854
+ "UserError",
1852
1855
  "Wishlist"
1853
1856
  ],
1854
- "body": "mutation WishlistRemoveItem($wishlistId: ID!, $itemId: ID!) {\n wishlistRemoveItem(wishlistId: $wishlistId, itemId: $itemId) {\n wishlist {\n ...Wishlist\n }\n userErrors\n }\n}"
1857
+ "body": "mutation WishlistRemoveItem($id: ID!, $itemId: ID!) {\n wishlistRemoveItem(id: $id, itemId: $itemId) {\n wishlist {\n ...Wishlist\n }\n userErrors {\n ...UserError\n }\n }\n}"
1855
1858
  },
1856
1859
  {
1857
1860
  "name": "WishlistDelete",
1858
1861
  "kind": "mutation",
1859
1862
  "section": "Wishlist Mutations",
1860
- "description": "Hard-deletes the wishlist row. All `WishlistItem` rows are removed via FK cascade. No soft-delete; cannot be undone.",
1863
+ "description": "Hard-deletes the wishlist row. All wishlist items are removed via cascade. No soft-delete; cannot be undone.",
1861
1864
  "variables": [
1862
1865
  {
1863
- "name": "wishlistId",
1866
+ "name": "id",
1864
1867
  "type": "ID!",
1865
1868
  "defaultValue": null
1866
1869
  }
1867
1870
  ],
1868
1871
  "fragmentRefs": [
1872
+ "UserError",
1869
1873
  "Wishlist"
1870
1874
  ],
1871
- "body": "mutation WishlistDelete($wishlistId: ID!) {\n wishlistDelete(wishlistId: $wishlistId) {\n wishlist {\n ...Wishlist\n }\n userErrors\n }\n}"
1875
+ "body": "mutation WishlistDelete($id: ID!) {\n wishlistDelete(id: $id) {\n wishlist {\n ...Wishlist\n }\n userErrors {\n ...UserError\n }\n }\n}"
1872
1876
  },
1873
1877
  {
1874
1878
  "name": "CartUpdateAttributes",
@@ -1976,28 +1980,6 @@
1976
1980
  "body": "fragment Money on Money {\n amount\n currencyCode\n}",
1977
1981
  "onType": "Money"
1978
1982
  },
1979
- {
1980
- "name": "Price",
1981
- "kind": "fragment",
1982
- "section": "Common",
1983
- "description": "Lightweight price for listing views (cards, grids, search results) — same shape as `Money`. Spread when full conversion metadata is overkill.",
1984
- "variables": [],
1985
- "fragmentRefs": [],
1986
- "body": "fragment Price on PriceMoney {\n amount\n currencyCode\n}",
1987
- "onType": "PriceMoney"
1988
- },
1989
- {
1990
- "name": "PriceMoney",
1991
- "kind": "fragment",
1992
- "section": "Common",
1993
- "description": "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.",
1994
- "variables": [],
1995
- "fragmentRefs": [
1996
- "Price"
1997
- ],
1998
- "body": "fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n}",
1999
- "onType": "PriceMoney"
2000
- },
2001
1983
  {
2002
1984
  "name": "SelectedOption",
2003
1985
  "kind": "fragment",
@@ -2032,7 +2014,7 @@
2032
2014
  "ImageCard",
2033
2015
  "Money"
2034
2016
  ],
2035
- "body": "fragment ProductCard on Product {\n id\n handle\n title\n vendor\n category\n isAvailable\n averageRating\n reviewCount\n tags\n featuredImage {\n ...ImageCard\n }\n priceRange {\n minVariantPrice {\n ...Money\n }\n maxVariantPrice {\n ...Money\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n ...Money\n }\n maxVariantPrice {\n ...Money\n }\n }\n}",
2017
+ "body": "fragment ProductCard on Product {\n id\n handle\n title\n vendor\n categories {\n id\n slug\n name\n }\n isAvailable\n averageRating\n reviewCount\n tags\n featuredImage {\n ...ImageCard\n }\n priceRange {\n minVariantPrice {\n ...Money\n }\n maxVariantPrice {\n ...Money\n }\n }\n compareAtPriceRange {\n minVariantPrice {\n ...Money\n }\n maxVariantPrice {\n ...Money\n }\n }\n}",
2036
2018
  "onType": "Product"
2037
2019
  },
2038
2020
  {
@@ -2358,7 +2340,7 @@
2358
2340
  "name": "ShippingRate",
2359
2341
  "kind": "fragment",
2360
2342
  "section": "Checkout",
2361
- "description": "Single shipping rate option — `handle` is the stable id you pass to `checkoutShippingLineUpdate`, plus title and price.",
2343
+ "description": "Single shipping rate option — `handle` is the stable id you pass to `checkoutSelectShippingRate` as `rateId`, plus title and price.",
2362
2344
  "variables": [],
2363
2345
  "fragmentRefs": [
2364
2346
  "Money"
@@ -2725,14 +2707,14 @@
2725
2707
  "name": "AvailableFilters",
2726
2708
  "kind": "fragment",
2727
2709
  "section": "Attribute Filters",
2728
- "description": "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.",
2710
+ "description": "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.",
2729
2711
  "variables": [],
2730
2712
  "fragmentRefs": [
2731
2713
  "AttributeDefinition",
2732
2714
  "CategoryFilterOption",
2733
2715
  "PriceRangeFilter"
2734
2716
  ],
2735
- "body": "fragment AvailableFilters on AvailableFilters {\n attributes {\n ...AttributeDefinition\n }\n priceRange {\n ...PriceRangeFilter\n }\n categories {\n ...CategoryFilterOption\n }\n activeFilterCount\n totalProducts\n}",
2717
+ "body": "fragment AvailableFilters on AvailableFilters {\n attributes {\n ...AttributeDefinition\n }\n priceRange {\n ...PriceRangeFilter\n }\n categories {\n ...CategoryFilterOption\n }\n activeCount\n matchCount\n}",
2736
2718
  "onType": "AvailableFilters"
2737
2719
  },
2738
2720
  {
@@ -2865,20 +2847,24 @@
2865
2847
  "name": "RedeemRewardPayload",
2866
2848
  "kind": "fragment",
2867
2849
  "section": "Loyalty Program",
2868
- "description": "Result of `redeemLoyaltyReward` — depending on the reward type, exactly one of `discountCode`, `productDiscountCode`, `giftCardCode` is populated. Apply the returned code on cart/checkout.",
2850
+ "description": "Result of `loyaltyRedeemReward` — depending on the reward type, exactly one of `discountCode`, `productDiscountCode`, `giftCardCode` is populated. Apply the returned code on cart/checkout.",
2869
2851
  "variables": [],
2870
- "fragmentRefs": [],
2871
- "body": "fragment RedeemRewardPayload on RedeemRewardPayload {\n success\n discountCode\n productDiscountCode\n giftCardCode\n userErrors\n}",
2852
+ "fragmentRefs": [
2853
+ "UserError"
2854
+ ],
2855
+ "body": "fragment RedeemRewardPayload on RedeemRewardPayload {\n success\n discountCode\n productDiscountCode\n giftCardCode\n userErrors {\n ...UserError\n }\n}",
2872
2856
  "onType": "RedeemRewardPayload"
2873
2857
  },
2874
2858
  {
2875
2859
  "name": "GenerateReferralCodePayload",
2876
2860
  "kind": "fragment",
2877
2861
  "section": "Loyalty Program",
2878
- "description": "Result of `generateReferralCode` — the customer's referral code and shareable URL.",
2862
+ "description": "Result of `loyaltyGenerateReferralCode` — the customer's referral code and shareable URL.",
2879
2863
  "variables": [],
2880
- "fragmentRefs": [],
2881
- "body": "fragment GenerateReferralCodePayload on GenerateReferralCodePayload {\n success\n referralCode\n shareUrl\n userErrors\n}",
2864
+ "fragmentRefs": [
2865
+ "UserError"
2866
+ ],
2867
+ "body": "fragment GenerateReferralCodePayload on GenerateReferralCodePayload {\n success\n referralCode\n shareUrl\n userErrors {\n ...UserError\n }\n}",
2882
2868
  "onType": "GenerateReferralCodePayload"
2883
2869
  },
2884
2870
  {
@@ -2961,30 +2947,6 @@
2961
2947
  "body": "fragment BlogPost on BlogPost {\n id\n title\n slug\n excerpt\n content\n contentFormat\n featuredImage {\n ...ImageCard\n }\n author {\n id\n name\n bio\n avatar {\n ...ImageThumbnail\n }\n }\n category {\n ...BlogCategory\n }\n tags {\n ...BlogTag\n }\n publishedAt\n readingTimeMinutes\n viewCount\n commentCount\n allowComments\n isFeatured\n status\n seo {\n title\n description\n }\n createdAt\n updatedAt\n}",
2962
2948
  "onType": "BlogPost"
2963
2949
  },
2964
- {
2965
- "name": "ProductRecommendation",
2966
- "kind": "fragment",
2967
- "section": "Recommendations",
2968
- "description": "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.",
2969
- "variables": [],
2970
- "fragmentRefs": [
2971
- "ProductCard"
2972
- ],
2973
- "body": "fragment ProductRecommendation on ProductRecommendation {\n product {\n ...ProductCard\n }\n type\n score\n reason\n}",
2974
- "onType": "ProductRecommendation"
2975
- },
2976
- {
2977
- "name": "CartRecommendation",
2978
- "kind": "fragment",
2979
- "section": "Recommendations",
2980
- "description": "Recommendations bundle for the cart drawer — `frequentlyBoughtTogether` (cross-sell) and `youMayAlsoLike` (related). Each entry has the same shape as `ProductRecommendation`.",
2981
- "variables": [],
2982
- "fragmentRefs": [
2983
- "ProductCard"
2984
- ],
2985
- "body": "fragment CartRecommendation on CartRecommendations {\n frequentlyBoughtTogether {\n product {\n ...ProductCard\n }\n type\n score\n reason\n }\n youMayAlsoLike {\n product {\n ...ProductCard\n }\n type\n score\n reason\n }\n}",
2986
- "onType": "CartRecommendations"
2987
- },
2988
2950
  {
2989
2951
  "name": "LocationAddress",
2990
2952
  "kind": "fragment",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doswiftly/storefront-operations",
3
- "version": "7.1.0",
3
+ "version": "8.0.0",
4
4
  "description": "GraphQL operations for DoSwiftly Storefront - SSOT from backend",
5
5
  "homepage": "https://doswiftly.pl",
6
6
  "publishConfig": {
@@ -39,6 +39,7 @@
39
39
  ],
40
40
  "scripts": {
41
41
  "sync": "node scripts/sync-operations.js",
42
+ "validate": "node scripts/validate-operations.js",
42
43
  "build": "npm run sync",
43
44
  "test": "node --test scripts/__tests__/*.test.js"
44
45
  }
package/queries.graphql CHANGED
@@ -26,7 +26,7 @@ query Product($id: ID, $handle: String) {
26
26
  }
27
27
 
28
28
  # 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.
29
- query ProductConfigurator($handle: String!, $fillingMode: String = "CUSTOMER") {
29
+ query ProductConfigurator($handle: String!, $fillingMode: AttributeFillingMode = CUSTOMER) {
30
30
  product(handle: $handle) {
31
31
  ...ProductFull
32
32
  attributes(filter: { fillingMode: $fillingMode }) {
@@ -81,8 +81,8 @@ query ProductSearch($query: String!, $first: Int = 20, $after: String, $filters:
81
81
  }
82
82
 
83
83
  # 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.
84
- query PredictiveSearch($query: String!, $limit: Int = 10) {
85
- predictiveSearch(query: $query, limit: $limit) {
84
+ query SearchSuggestions($query: String!, $limit: Int = 10) {
85
+ searchSuggestions(query: $query, limit: $limit) {
86
86
  products {
87
87
  ...ProductCard
88
88
  }
@@ -152,10 +152,10 @@ query Category($id: ID, $slug: String) {
152
152
  }
153
153
  }
154
154
 
155
- # 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.
155
+ # 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.
156
156
  query Categories {
157
- categories {
158
- roots {
157
+ categories(rootsOnly: true) {
158
+ nodes {
159
159
  ...Category
160
160
  children {
161
161
  ...Category
@@ -367,8 +367,8 @@ query AvailableShippingMethods($address: ShippingAddressInput!, $cart: CartShipp
367
367
  # ============================================
368
368
 
369
369
  # 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.
370
- query AvailableFilters($input: AvailableFiltersInput) {
371
- availableFilters(input: $input) {
370
+ query ProductFilters($input: AvailableFiltersInput) {
371
+ productFilters(input: $input) {
372
372
  ...AvailableFilters
373
373
  }
374
374
  }
@@ -612,7 +612,9 @@ query ProductStoreAvailability($handle: String, $id: ID) {
612
612
  handle
613
613
  title
614
614
  variants {
615
- ...VariantStoreAvailability
615
+ nodes {
616
+ ...VariantStoreAvailability
617
+ }
616
618
  }
617
619
  }
618
620
  }