@doswiftly/storefront-operations 16.1.0 → 18.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 +3 -3
- package/CHANGELOG.md +880 -0
- package/README.md +10 -7
- package/fragments.graphql +65 -16
- package/llms-full.txt +135 -24
- package/mutations.graphql +24 -2
- package/operations.json +84 -26
- package/package.json +4 -2
- package/schema.graphql +885 -187
package/mutations.graphql
CHANGED
|
@@ -329,7 +329,11 @@ mutation CartSelectShippingMethod($input: CartSelectShippingMethodInput!) {
|
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
-
# Selects a payment method by
|
|
332
|
+
# Selects a payment method on the cart by category (`methodType` — BLIK, CARD, BANK_TRANSFER, ...).
|
|
333
|
+
# Optional `preferredProvider` overrides the merchant priority when the buyer explicitly picks
|
|
334
|
+
# a gateway from `PaymentMethod.providersAvailable`. The backend resolves the gateway routing
|
|
335
|
+
# from `MerchantPaymentConfig` at `cartComplete`; the selection persisted here is the category.
|
|
336
|
+
# Errors: `PAYMENT_METHOD_REQUIRED`, `CART_NOT_FOUND`, `CART_UNAUTHENTICATED`.
|
|
333
337
|
mutation CartSelectPaymentMethod($input: CartSelectPaymentMethodInput!) {
|
|
334
338
|
cartSelectPaymentMethod(input: $input) {
|
|
335
339
|
cart {
|
|
@@ -404,7 +408,7 @@ mutation CartComplete($input: CartCompleteInput!) {
|
|
|
404
408
|
}
|
|
405
409
|
}
|
|
406
410
|
|
|
407
|
-
# Initiates a payment session for an order created by `cartComplete` — call this when `order.canCreatePayment` is `true` (orders with an offline payment method like cash-on-delivery skip this step). `orderId` is required; `returnUrl` / `cancelUrl` are optional and, when supplied, must point to a verified domain of the shop (open-redirect protected). Branch on the returned `payment.flow`: `ONLINE_REDIRECT` → redirect to `payment.redirectUrl`, `ONLINE_EMBEDDED` → render a widget with `payment.clientSecret`, `INSTANT_DIRECT` → already settled, read `payment.status`. Public, but ownership-checked — an authenticated customer cannot pay for another customer's order. **Idempotent** — calling it again for the same order returns the existing still-valid session instead of creating a duplicate (safe to retry). Rate limit: 5 requests/minute. `userErrors[].code`: `ORDER_NOT_FOUND`, `ORDER_ALREADY_PAID`, `ORDER_NOT_PAYABLE`, `PAYMENT_PROVIDER_NOT_CONFIGURED`, `RETURN_URL_INVALID`, `INVALID_ID_FORMAT`, `PAYMENT_FAILED`.
|
|
411
|
+
# Initiates a payment session for an order created by `cartComplete` — call this when `order.canCreatePayment` is `true` (orders with an offline payment method like cash-on-delivery skip this step). `orderId` is required; `returnUrl` / `cancelUrl` are optional and, when supplied, must point to a verified domain of the shop (open-redirect protected). Branch on the returned `payment.flow`: `ONLINE_REDIRECT` → redirect to `payment.redirectUrl`, `ONLINE_EMBEDDED` → render a widget with `payment.clientSecret`, `INSTANT_DIRECT` → already settled, read `payment.status`. Public, but ownership-checked — an authenticated customer cannot pay for another customer's order. **Idempotent** — calling it again for the same order returns the existing still-valid session instead of creating a duplicate (safe to retry). Rate limit: 5 requests/minute. `userErrors[].code`: `ORDER_NOT_FOUND`, `ORDER_ALREADY_PAID`, `ORDER_NOT_PAYABLE`, `PAYMENT_PROVIDER_NOT_CONFIGURED`, `RETURN_URL_INVALID`, `INVALID_ID_FORMAT`, `PAYMENT_FAILED`, `INSTRUMENT_PRESELECTION_FAILED`. `warnings[]` array zawiera `INSTRUMENT_CLEARED_FOR_RETRY` post-auto-clear instrument-specific failure (storefront retry hint: next attempt uses gateway default landing).
|
|
408
412
|
mutation PaymentCreate($input: PaymentCreateInput!) {
|
|
409
413
|
paymentCreate(input: $input) {
|
|
410
414
|
payment {
|
|
@@ -413,6 +417,24 @@ mutation PaymentCreate($input: PaymentCreateInput!) {
|
|
|
413
417
|
userErrors {
|
|
414
418
|
...UserError
|
|
415
419
|
}
|
|
420
|
+
warnings {
|
|
421
|
+
...PaymentWarning
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
# Clears all payment selection state on the cart in a single atomic operation. Use for accordion "back to method picker" flows w storefront UI. Idempotent — calling twice yields the same end state. Cart MUSI być `ACTIVE` (CONVERTED carts reject z `ALREADY_COMPLETED`). Rate limit: 30 requests/minute per IP+shop.
|
|
427
|
+
mutation CartClearPaymentSelection($input: CartClearPaymentSelectionInput!) {
|
|
428
|
+
cartClearPaymentSelection(input: $input) {
|
|
429
|
+
cart {
|
|
430
|
+
...Cart
|
|
431
|
+
}
|
|
432
|
+
userErrors {
|
|
433
|
+
...UserError
|
|
434
|
+
}
|
|
435
|
+
warnings {
|
|
436
|
+
...CartWarning
|
|
437
|
+
}
|
|
416
438
|
}
|
|
417
439
|
}
|
|
418
440
|
|
package/operations.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion": "
|
|
2
|
+
"schemaVersion": "18.0.0",
|
|
3
3
|
"queries": [
|
|
4
4
|
{
|
|
5
5
|
"name": "Shop",
|
|
@@ -1518,7 +1518,7 @@
|
|
|
1518
1518
|
"name": "CartSelectPaymentMethod",
|
|
1519
1519
|
"kind": "mutation",
|
|
1520
1520
|
"section": "Cart Completion Mutations",
|
|
1521
|
-
"description": "Selects a payment method by `
|
|
1521
|
+
"description": "Selects a payment method on the cart by category (`methodType` — BLIK, CARD, BANK_TRANSFER, ...). Optional `preferredProvider` overrides the merchant priority when the buyer explicitly picks a gateway from `PaymentMethod.providersAvailable`. The backend resolves the gateway routing from `MerchantPaymentConfig` at `cartComplete`; the selection persisted here is the category. Errors: `PAYMENT_METHOD_REQUIRED`, `CART_NOT_FOUND`, `CART_UNAUTHENTICATED`.",
|
|
1522
1522
|
"variables": [
|
|
1523
1523
|
{
|
|
1524
1524
|
"name": "input",
|
|
@@ -1613,7 +1613,7 @@
|
|
|
1613
1613
|
"name": "PaymentCreate",
|
|
1614
1614
|
"kind": "mutation",
|
|
1615
1615
|
"section": "Cart Completion Mutations",
|
|
1616
|
-
"description": "Initiates a payment session for an order created by `cartComplete` — call this when `order.canCreatePayment` is `true` (orders with an offline payment method like cash-on-delivery skip this step). `orderId` is required; `returnUrl` / `cancelUrl` are optional and, when supplied, must point to a verified domain of the shop (open-redirect protected). Branch on the returned `payment.flow`: `ONLINE_REDIRECT` → redirect to `payment.redirectUrl`, `ONLINE_EMBEDDED` → render a widget with `payment.clientSecret`, `INSTANT_DIRECT` → already settled, read `payment.status`. Public, but ownership-checked — an authenticated customer cannot pay for another customer's order. **Idempotent** — calling it again for the same order returns the existing still-valid session instead of creating a duplicate (safe to retry). Rate limit: 5 requests/minute. `userErrors[].code`: `ORDER_NOT_FOUND`, `ORDER_ALREADY_PAID`, `ORDER_NOT_PAYABLE`, `PAYMENT_PROVIDER_NOT_CONFIGURED`, `RETURN_URL_INVALID`, `INVALID_ID_FORMAT`, `PAYMENT_FAILED`.",
|
|
1616
|
+
"description": "Initiates a payment session for an order created by `cartComplete` — call this when `order.canCreatePayment` is `true` (orders with an offline payment method like cash-on-delivery skip this step). `orderId` is required; `returnUrl` / `cancelUrl` are optional and, when supplied, must point to a verified domain of the shop (open-redirect protected). Branch on the returned `payment.flow`: `ONLINE_REDIRECT` → redirect to `payment.redirectUrl`, `ONLINE_EMBEDDED` → render a widget with `payment.clientSecret`, `INSTANT_DIRECT` → already settled, read `payment.status`. Public, but ownership-checked — an authenticated customer cannot pay for another customer's order. **Idempotent** — calling it again for the same order returns the existing still-valid session instead of creating a duplicate (safe to retry). Rate limit: 5 requests/minute. `userErrors[].code`: `ORDER_NOT_FOUND`, `ORDER_ALREADY_PAID`, `ORDER_NOT_PAYABLE`, `PAYMENT_PROVIDER_NOT_CONFIGURED`, `RETURN_URL_INVALID`, `INVALID_ID_FORMAT`, `PAYMENT_FAILED`, `INSTRUMENT_PRESELECTION_FAILED`. `warnings[]` array zawiera `INSTRUMENT_CLEARED_FOR_RETRY` post-auto-clear instrument-specific failure (storefront retry hint: next attempt uses gateway default landing).",
|
|
1617
1617
|
"variables": [
|
|
1618
1618
|
{
|
|
1619
1619
|
"name": "input",
|
|
@@ -1623,9 +1623,29 @@
|
|
|
1623
1623
|
],
|
|
1624
1624
|
"fragmentRefs": [
|
|
1625
1625
|
"PaymentSession",
|
|
1626
|
+
"PaymentWarning",
|
|
1626
1627
|
"UserError"
|
|
1627
1628
|
],
|
|
1628
|
-
"body": "mutation PaymentCreate($input: PaymentCreateInput!) {\n paymentCreate(input: $input) {\n payment {\n ...PaymentSession\n }\n userErrors {\n ...UserError\n }\n }\n}"
|
|
1629
|
+
"body": "mutation PaymentCreate($input: PaymentCreateInput!) {\n paymentCreate(input: $input) {\n payment {\n ...PaymentSession\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...PaymentWarning\n }\n }\n}"
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
"name": "CartClearPaymentSelection",
|
|
1633
|
+
"kind": "mutation",
|
|
1634
|
+
"section": "Cart Completion Mutations",
|
|
1635
|
+
"description": "Clears all payment selection state on the cart in a single atomic operation. Use for accordion \"back to method picker\" flows w storefront UI. Idempotent — calling twice yields the same end state. Cart MUSI być `ACTIVE` (CONVERTED carts reject z `ALREADY_COMPLETED`). Rate limit: 30 requests/minute per IP+shop.",
|
|
1636
|
+
"variables": [
|
|
1637
|
+
{
|
|
1638
|
+
"name": "input",
|
|
1639
|
+
"type": "CartClearPaymentSelectionInput!",
|
|
1640
|
+
"defaultValue": null
|
|
1641
|
+
}
|
|
1642
|
+
],
|
|
1643
|
+
"fragmentRefs": [
|
|
1644
|
+
"Cart",
|
|
1645
|
+
"CartWarning",
|
|
1646
|
+
"UserError"
|
|
1647
|
+
],
|
|
1648
|
+
"body": "mutation CartClearPaymentSelection($input: CartClearPaymentSelectionInput!) {\n cartClearPaymentSelection(input: $input) {\n cart {\n ...Cart\n }\n userErrors {\n ...UserError\n }\n warnings {\n ...CartWarning\n }\n }\n}"
|
|
1629
1649
|
},
|
|
1630
1650
|
{
|
|
1631
1651
|
"name": "ReturnCreate",
|
|
@@ -2177,7 +2197,7 @@
|
|
|
2177
2197
|
"MailingAddress",
|
|
2178
2198
|
"PageInfo"
|
|
2179
2199
|
],
|
|
2180
|
-
"body": "fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost {\n ...CartCost\n }\n lines(first: 100) {\n edges {\n cursor\n node {\n ... on CartLine {\n ...CartLine\n }\n }\n }\n nodes {\n ... on CartLine {\n ...CartLine\n }\n }\n pageInfo {\n ...PageInfo\n }\n totalCount\n }\n buyerIdentity {\n ...CartBuyerIdentity\n }\n discountCodes {\n ...CartDiscountCode\n }\n discountAllocations {\n ...CartDiscountAllocation\n }\n note\n attributes {\n key\n value\n }\n email\n phone\n shippingAddress {\n ...MailingAddress\n }\n billingAddress {\n ...MailingAddress\n }\n selectedShippingMethod {\n ...CartShippingMethod\n }\n selectedPaymentMethod {\n ...CartSelectedPaymentMethod\n }\n appliedGiftCards {\n ...CartAppliedGiftCard\n }\n requiresShipping\n createdAt\n updatedAt\n status\n completedOrder {\n id\n orderNumber\n accessToken\n status\n paymentStatus\n fulfillmentStatus\n }\n}",
|
|
2200
|
+
"body": "fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost {\n ...CartCost\n }\n lines(first: 100) {\n edges {\n cursor\n node {\n ... on CartLine {\n ...CartLine\n }\n }\n }\n nodes {\n ... on CartLine {\n ...CartLine\n }\n }\n pageInfo {\n ...PageInfo\n }\n totalCount\n }\n buyerIdentity {\n ...CartBuyerIdentity\n }\n discountCodes {\n ...CartDiscountCode\n }\n discountAllocations {\n ...CartDiscountAllocation\n }\n note\n attributes {\n key\n value\n }\n email\n phone\n shippingAddress {\n ...MailingAddress\n }\n billingAddress {\n ...MailingAddress\n }\n selectedShippingMethod {\n ...CartShippingMethod\n }\n selectedPaymentMethod {\n ...CartSelectedPaymentMethod\n }\n selectedPaymentInstrument\n appliedGiftCards {\n ...CartAppliedGiftCard\n }\n requiresShipping\n createdAt\n updatedAt\n status\n completedOrder {\n id\n orderNumber\n accessToken\n status\n paymentStatus\n fulfillmentStatus\n }\n}",
|
|
2181
2201
|
"onType": "Cart"
|
|
2182
2202
|
},
|
|
2183
2203
|
{
|
|
@@ -2208,10 +2228,12 @@
|
|
|
2208
2228
|
"name": "CartSelectedPaymentMethod",
|
|
2209
2229
|
"kind": "fragment",
|
|
2210
2230
|
"section": "Cart",
|
|
2211
|
-
"description": "Payment method (integration provider) selected on a cart — id, name, provider code, type category (CARD/BLIK/BANK_TRANSFER/etc.), icon, description, isDefault, supportedCurrencies. Storefront UI używa do iconography + selection display.",
|
|
2231
|
+
"description": "Payment method (integration provider) selected on a cart — id, name, provider code, type category (CARD/BLIK/BANK_TRANSFER/etc.), icon image (transformable), description, isDefault, supportedCurrencies. Storefront UI używa do iconography + selection display.",
|
|
2212
2232
|
"variables": [],
|
|
2213
|
-
"fragmentRefs": [
|
|
2214
|
-
|
|
2233
|
+
"fragmentRefs": [
|
|
2234
|
+
"ImageThumbnail"
|
|
2235
|
+
],
|
|
2236
|
+
"body": "fragment CartSelectedPaymentMethod on PaymentMethod {\n id\n name\n provider\n type\n icon {\n ...ImageThumbnail\n }\n description\n isDefault\n supportedCurrencies\n position\n}",
|
|
2215
2237
|
"onType": "PaymentMethod"
|
|
2216
2238
|
},
|
|
2217
2239
|
{
|
|
@@ -2329,14 +2351,29 @@
|
|
|
2329
2351
|
"body": "fragment ShopConfigFields on Shop {\n currencyCode\n supportedCurrencies\n localeToCurrencyMap {\n locale\n currency\n }\n defaultLanguage\n supportedLanguages\n botProtection {\n ...BotProtection\n }\n}",
|
|
2330
2352
|
"onType": "Shop"
|
|
2331
2353
|
},
|
|
2354
|
+
{
|
|
2355
|
+
"name": "PaymentInstrument",
|
|
2356
|
+
"kind": "fragment",
|
|
2357
|
+
"section": "Payment Methods",
|
|
2358
|
+
"description": "A single concrete instrument exposed by a gateway provider (BLIK code, branded bank, wallet, card brand). Pass `code` as `preferredInstrument` in `cartSelectPaymentMethod` for direct deep-link to that instrument screen on the gateway. `displayHint` is a semantic UX hint (`PROMINENT_BUTTON`, `BRANDED_TILE`, `DROPDOWN_OPTION`, `RADIO_OPTION`) — storefront branches rendering accordingly. `enabled: false` means the gateway reported the instrument as temporarily disabled — gray out, don't hide.",
|
|
2359
|
+
"variables": [],
|
|
2360
|
+
"fragmentRefs": [
|
|
2361
|
+
"ImageThumbnail"
|
|
2362
|
+
],
|
|
2363
|
+
"body": "fragment PaymentInstrument on PaymentInstrument {\n provider\n code\n type\n displayName\n displayHint\n brandImage {\n ...ImageThumbnail\n }\n enabled\n}",
|
|
2364
|
+
"onType": "PaymentInstrument"
|
|
2365
|
+
},
|
|
2332
2366
|
{
|
|
2333
2367
|
"name": "PaymentMethod",
|
|
2334
2368
|
"kind": "fragment",
|
|
2335
2369
|
"section": "Payment Methods",
|
|
2336
|
-
"description": "Single payment method enabled for the shop — type (CARD
|
|
2370
|
+
"description": "Single payment method enabled for the shop — method-centric. `type` is the category (CARD, BLIK, BANK_TRANSFER, INSTALLMENT, WALLET, CASH_ON_DELIVERY, OTHER) — drive iconography here. `provider`, `providersAvailable`, `preferredProvider` are `PaymentProvider` enum (UPPERCASE: `PAYU`, `PRZELEWY24`, ...). `available` is `false` when the resolving gateway is temporarily unavailable or reported the method as disabled — gray-out the tile, don't hide it; `unavailableReason` carries the diagnostic. `instruments` lists concrete gateway-side instruments (BLIK code, branded banks, wallets) when the gateway exposes granular data — pass `code` as `preferredInstrument` in `cartSelectPaymentMethod` for direct deep-link to that instrument screen on the gateway. Spread on the checkout payment step.",
|
|
2337
2371
|
"variables": [],
|
|
2338
|
-
"fragmentRefs": [
|
|
2339
|
-
|
|
2372
|
+
"fragmentRefs": [
|
|
2373
|
+
"ImageThumbnail",
|
|
2374
|
+
"PaymentInstrument"
|
|
2375
|
+
],
|
|
2376
|
+
"body": "fragment PaymentMethod on PaymentMethod {\n id\n name\n provider\n type\n icon {\n ...ImageThumbnail\n }\n description\n isDefault\n supportedCurrencies\n position\n providersAvailable\n preferredProvider\n available\n unavailableReason\n instruments {\n ...PaymentInstrument\n }\n}",
|
|
2340
2377
|
"onType": "PaymentMethod"
|
|
2341
2378
|
},
|
|
2342
2379
|
{
|
|
@@ -2361,6 +2398,16 @@
|
|
|
2361
2398
|
"body": "fragment PaymentSession on PaymentSession {\n id\n orderId\n flow\n provider\n redirectUrl\n clientSecret\n status\n expiresAt\n}",
|
|
2362
2399
|
"onType": "PaymentSession"
|
|
2363
2400
|
},
|
|
2401
|
+
{
|
|
2402
|
+
"name": "PaymentWarning",
|
|
2403
|
+
"kind": "fragment",
|
|
2404
|
+
"section": "Payment Methods",
|
|
2405
|
+
"description": "Non-blocking signal emitted alongside `userErrors[]` in `paymentCreate` payload — backend state change context (e.g. an auto-clear of preselected instrument after gateway rejection). Pre-translated by backend per shop locale. `code === 'INSTRUMENT_CLEARED_FOR_RETRY'` signals storefront that the next `paymentCreate` will land on the gateway default landing page (server-side cleared `Order.paymentInstrumentCode` after `INSTRUMENT_PRESELECTION_FAILED`). `retryHint` is optional context for UI dispatch — currently unused for `INSTRUMENT_CLEARED_FOR_RETRY`, reserved for future warning codes.",
|
|
2406
|
+
"variables": [],
|
|
2407
|
+
"fragmentRefs": [],
|
|
2408
|
+
"body": "fragment PaymentWarning on PaymentWarning {\n message\n code\n retryHint\n}",
|
|
2409
|
+
"onType": "PaymentWarning"
|
|
2410
|
+
},
|
|
2364
2411
|
{
|
|
2365
2412
|
"name": "ShipmentEvent",
|
|
2366
2413
|
"kind": "fragment",
|
|
@@ -2385,10 +2432,12 @@
|
|
|
2385
2432
|
"name": "ShipmentItem",
|
|
2386
2433
|
"kind": "fragment",
|
|
2387
2434
|
"section": "Shipments / Tracking",
|
|
2388
|
-
"description": "One item in a shipment — title, variant, sku, quantity, image
|
|
2435
|
+
"description": "One item in a shipment — title, variant, sku, quantity, live variant image (transformable). Spread inside `Shipment.items[]` for the tracking page item list. `image` is live from the current variant (snapshot fallback when variant has been deleted since fulfillment — returns null, render a placeholder).",
|
|
2389
2436
|
"variables": [],
|
|
2390
|
-
"fragmentRefs": [
|
|
2391
|
-
|
|
2437
|
+
"fragmentRefs": [
|
|
2438
|
+
"ImageThumbnail"
|
|
2439
|
+
],
|
|
2440
|
+
"body": "fragment ShipmentItem on ShipmentItem {\n id\n title\n variantTitle\n sku\n quantity\n image {\n ...ImageThumbnail\n }\n}",
|
|
2392
2441
|
"onType": "ShipmentItem"
|
|
2393
2442
|
},
|
|
2394
2443
|
{
|
|
@@ -2443,10 +2492,11 @@
|
|
|
2443
2492
|
"description": "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[]`.",
|
|
2444
2493
|
"variables": [],
|
|
2445
2494
|
"fragmentRefs": [
|
|
2495
|
+
"ImageThumbnail",
|
|
2446
2496
|
"Money",
|
|
2447
2497
|
"ReturnItemPhoto"
|
|
2448
2498
|
],
|
|
2449
|
-
"body": "fragment ReturnItem on ReturnItem {\n id\n variantId\n productTitle\n variantTitle\n sku\n
|
|
2499
|
+
"body": "fragment ReturnItem on ReturnItem {\n id\n variantId\n productTitle\n variantTitle\n sku\n image {\n ...ImageThumbnail\n }\n quantity\n reason\n condition\n unitPrice {\n ...Money\n }\n photos {\n ...ReturnItemPhoto\n }\n status\n approvedQuantity\n}",
|
|
2450
2500
|
"onType": "ReturnItem"
|
|
2451
2501
|
},
|
|
2452
2502
|
{
|
|
@@ -2513,10 +2563,12 @@
|
|
|
2513
2563
|
"name": "ShippingCarrier",
|
|
2514
2564
|
"kind": "fragment",
|
|
2515
2565
|
"section": "Shipping Methods",
|
|
2516
|
-
"description": "Carrier offering the shipping method — id, display name, logo
|
|
2566
|
+
"description": "Carrier offering the shipping method — id, display name, logo image (transformable), internal service code.",
|
|
2517
2567
|
"variables": [],
|
|
2518
|
-
"fragmentRefs": [
|
|
2519
|
-
|
|
2568
|
+
"fragmentRefs": [
|
|
2569
|
+
"ImageThumbnail"
|
|
2570
|
+
],
|
|
2571
|
+
"body": "fragment ShippingCarrier on ShippingCarrier {\n id\n name\n logo {\n ...ImageThumbnail\n }\n serviceCode\n}",
|
|
2520
2572
|
"onType": "ShippingCarrier"
|
|
2521
2573
|
},
|
|
2522
2574
|
{
|
|
@@ -2560,10 +2612,12 @@
|
|
|
2560
2612
|
"name": "AttributeSwatch",
|
|
2561
2613
|
"kind": "fragment",
|
|
2562
2614
|
"section": "Attribute Filters",
|
|
2563
|
-
"description": "Visual swatch for an attribute filter value — color hex (for color filters) or image
|
|
2615
|
+
"description": "Visual swatch for an attribute filter value — color hex (for color filters) or image (for pattern/material swatches).",
|
|
2564
2616
|
"variables": [],
|
|
2565
|
-
"fragmentRefs": [
|
|
2566
|
-
|
|
2617
|
+
"fragmentRefs": [
|
|
2618
|
+
"ImageThumbnail"
|
|
2619
|
+
],
|
|
2620
|
+
"body": "fragment AttributeSwatch on AttributeSwatch {\n colorHex\n image {\n ...ImageThumbnail\n }\n}",
|
|
2567
2621
|
"onType": "AttributeSwatch"
|
|
2568
2622
|
},
|
|
2569
2623
|
{
|
|
@@ -2655,9 +2709,10 @@
|
|
|
2655
2709
|
"description": "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.",
|
|
2656
2710
|
"variables": [],
|
|
2657
2711
|
"fragmentRefs": [
|
|
2712
|
+
"ImageThumbnail",
|
|
2658
2713
|
"Money"
|
|
2659
2714
|
],
|
|
2660
|
-
"body": "fragment LoyaltyTier on LoyaltyTier {\n id\n name\n type\n minPoints\n minAnnualSpend {\n ...Money\n }\n pointsMultiplier\n customBenefits {\n name\n description\n icon\n }\n}",
|
|
2715
|
+
"body": "fragment LoyaltyTier on LoyaltyTier {\n id\n name\n type\n minPoints\n minAnnualSpend {\n ...Money\n }\n pointsMultiplier\n customBenefits {\n name\n description\n icon {\n ...ImageThumbnail\n }\n }\n}",
|
|
2661
2716
|
"onType": "LoyaltyTier"
|
|
2662
2717
|
},
|
|
2663
2718
|
{
|
|
@@ -2794,8 +2849,10 @@
|
|
|
2794
2849
|
"section": "Reviews",
|
|
2795
2850
|
"description": "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.",
|
|
2796
2851
|
"variables": [],
|
|
2797
|
-
"fragmentRefs": [
|
|
2798
|
-
|
|
2852
|
+
"fragmentRefs": [
|
|
2853
|
+
"ImageThumbnail"
|
|
2854
|
+
],
|
|
2855
|
+
"body": "fragment ProductReview on ProductReview {\n id\n productId\n rating\n title\n content\n pros\n cons\n images {\n ...ImageThumbnail\n }\n authorName\n isVerifiedPurchase\n helpfulCount\n unhelpfulCount\n response\n responseAt\n createdAt\n}",
|
|
2799
2856
|
"onType": "ProductReview"
|
|
2800
2857
|
},
|
|
2801
2858
|
{
|
|
@@ -2967,9 +3024,10 @@
|
|
|
2967
3024
|
"description": "One menu item with up to 3 levels of nested children — title, URL, type (`HTTP` / `FRONTPAGE` / `SEARCH` / `CATALOG` / `BLOG` / `PRODUCT` / `COLLECTION` / `CATEGORY` / `PAGE` / `BRAND`), `resourceId` for typed items, optional image, and a typed `resource` union (Category / Collection / ShopPage / Product / Brand) carrying the linked resource's handle. Two ways to render the link target: (1) use the pre-resolved `url` if your storefront follows the standard `/categories|/collections|/pages|/products|/brands/<handle>` route convention; (2) read `resource.__typename` + the per-type `handle` and build your own paths if your storefront uses different routing. Switch on `type` to decide which static (FRONTPAGE/SEARCH/CATALOG/BLOG) or dynamic target to render.",
|
|
2968
3025
|
"variables": [],
|
|
2969
3026
|
"fragmentRefs": [
|
|
2970
|
-
"Image"
|
|
3027
|
+
"Image",
|
|
3028
|
+
"ImageThumbnail"
|
|
2971
3029
|
],
|
|
2972
|
-
"body": "fragment MenuItem on MenuItem {\n id\n title\n url\n type\n resourceId\n resource {\n __typename\n ... on Category {\n id\n handle\n name\n }\n ... on Collection {\n id\n handle\n title\n }\n ... on ShopPage {\n id\n handle\n title\n }\n ... on Product {\n id\n handle\n title\n }\n ... on Brand {\n id\n handle\n name\n logo\n }\n }\n image {\n ...Image\n }\n items {\n id\n title\n url\n type\n resourceId\n resource {\n __typename\n ... on Category {\n id\n handle\n name\n }\n ... on Collection {\n id\n handle\n title\n }\n ... on ShopPage {\n id\n handle\n title\n }\n ... on Product {\n id\n handle\n title\n }\n ... on Brand {\n id\n handle\n name\n logo\n }\n }\n items {\n id\n title\n url\n type\n resourceId\n resource {\n __typename\n ... on Category {\n id\n handle\n name\n }\n ... on Collection {\n id\n handle\n title\n }\n ... on ShopPage {\n id\n handle\n title\n }\n ... on Product {\n id\n handle\n title\n }\n ... on Brand {\n id\n handle\n name\n logo\n }\n }\n }\n }\n}",
|
|
3030
|
+
"body": "fragment MenuItem on MenuItem {\n id\n title\n url\n type\n resourceId\n resource {\n __typename\n ... on Category {\n id\n handle\n name\n }\n ... on Collection {\n id\n handle\n title\n }\n ... on ShopPage {\n id\n handle\n title\n }\n ... on Product {\n id\n handle\n title\n }\n ... on Brand {\n id\n handle\n name\n logo {\n ...ImageThumbnail\n }\n }\n }\n image {\n ...Image\n }\n items {\n id\n title\n url\n type\n resourceId\n resource {\n __typename\n ... on Category {\n id\n handle\n name\n }\n ... on Collection {\n id\n handle\n title\n }\n ... on ShopPage {\n id\n handle\n title\n }\n ... on Product {\n id\n handle\n title\n }\n ... on Brand {\n id\n handle\n name\n logo {\n ...ImageThumbnail\n }\n }\n }\n items {\n id\n title\n url\n type\n resourceId\n resource {\n __typename\n ... on Category {\n id\n handle\n name\n }\n ... on Collection {\n id\n handle\n title\n }\n ... on ShopPage {\n id\n handle\n title\n }\n ... on Product {\n id\n handle\n title\n }\n ... on Brand {\n id\n handle\n name\n logo {\n ...ImageThumbnail\n }\n }\n }\n }\n }\n}",
|
|
2973
3031
|
"onType": "MenuItem"
|
|
2974
3032
|
},
|
|
2975
3033
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doswiftly/storefront-operations",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "GraphQL operations for DoSwiftly Storefront - SSOT from backend",
|
|
5
5
|
"homepage": "https://doswiftly.pl",
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"./queries.graphql": "./queries.graphql",
|
|
13
13
|
"./mutations.graphql": "./mutations.graphql",
|
|
14
14
|
"./fragments.graphql": "./fragments.graphql",
|
|
15
|
+
"./operations.json": "./operations.json",
|
|
15
16
|
"./*.graphql": "./*.graphql"
|
|
16
17
|
},
|
|
17
18
|
"devDependencies": {
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
"sync": "node scripts/sync-operations.js",
|
|
42
43
|
"validate": "node scripts/validate-operations.js",
|
|
43
44
|
"build": "npm run sync",
|
|
44
|
-
"test": "node --test scripts/__tests__/*.test.js"
|
|
45
|
+
"test": "node --test scripts/__tests__/*.test.js",
|
|
46
|
+
"yalc:push": "yalc publish --push"
|
|
45
47
|
}
|
|
46
48
|
}
|