@doswiftly/storefront-operations 13.0.0 → 14.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 +2 -2
- package/CHANGELOG.md +244 -0
- package/README.md +14 -13
- package/fragments.graphql +41 -15
- package/llms-full.txt +156 -34
- package/operations.json +56 -32
- package/package.json +1 -1
- package/queries.graphql +31 -12
- package/schema.graphql +165 -78
package/operations.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion": "
|
|
2
|
+
"schemaVersion": "14.0.0",
|
|
3
3
|
"queries": [
|
|
4
4
|
{
|
|
5
5
|
"name": "Shop",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"name": "Product",
|
|
17
17
|
"kind": "query",
|
|
18
18
|
"section": "Products",
|
|
19
|
-
"description": "Fetches a single product by `id` or `handle` (URL
|
|
19
|
+
"description": "Fetches a single product by `id` or `handle` (URL-friendly identifier). Pass either — whichever is provided wins; if both are missing, returns null. Returns null if the product is not storefront-accessible (must be `ACTIVE` status with `PUBLIC` or `BUNDLE_ONLY` visibility).",
|
|
20
20
|
"variables": [
|
|
21
21
|
{
|
|
22
22
|
"name": "id",
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
"name": "Category",
|
|
237
237
|
"kind": "query",
|
|
238
238
|
"section": "Categories",
|
|
239
|
-
"description": "Fetches a single category by `id` or `
|
|
239
|
+
"description": "Fetches a single category by `id` or `handle` 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.",
|
|
240
240
|
"variables": [
|
|
241
241
|
{
|
|
242
242
|
"name": "id",
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
"defaultValue": null
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
|
-
"name": "
|
|
247
|
+
"name": "handle",
|
|
248
248
|
"type": "String",
|
|
249
249
|
"defaultValue": null
|
|
250
250
|
}
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
"fragmentRefs": [
|
|
253
253
|
"Category"
|
|
254
254
|
],
|
|
255
|
-
"body": "query Category($id: ID, $
|
|
255
|
+
"body": "query Category($id: ID, $handle: String) {\n category(id: $id, handle: $handle) {\n ...Category\n parent {\n ...Category\n }\n children {\n ...Category\n }\n }\n}"
|
|
256
256
|
},
|
|
257
257
|
{
|
|
258
258
|
"name": "Categories",
|
|
@@ -504,7 +504,7 @@
|
|
|
504
504
|
"name": "AvailableShippingMethods",
|
|
505
505
|
"kind": "query",
|
|
506
506
|
"section": "Shipping Methods",
|
|
507
|
-
"description": "Returns shipping methods for a given destination address and cart shape (subtotal, total weight, currency). The query computes everything from the inputs alone — no existing cart is required, so it can be used for \"shipping cost preview\" UIs before the customer adds anything to a cart. Each method includes price, free-shipping progress (`{ qualifies, currentAmount, threshold, remaining, progressPercent }`), estimated delivery, and carrier metadata. Sorted by the merchant's `sortOrder`, then by price.",
|
|
507
|
+
"description": "Returns shipping methods for a given destination address and cart shape (subtotal, total weight, currency). The query computes everything from the inputs alone — no existing cart is required, so it can be used for \"shipping cost preview\" UIs (e.g. product detail page shipping calculator) before the customer adds anything to a cart. Each method includes price, free-shipping progress (`{ qualifies, currentAmount, threshold, remaining, progressPercent }`), estimated delivery, and carrier metadata. Sorted by the merchant's `sortOrder`, then by price. For a cart-bound checkout flow (where the cart is already known and the storefront wants the resolver to skip non-physical items and surface a `DIGITAL_ONLY_NO_SHIPPING` user error for all-digital carts), use `CartAvailableShippingMethods` against `cart.availableShippingMethods(address)` instead.",
|
|
508
508
|
"variables": [
|
|
509
509
|
{
|
|
510
510
|
"name": "address",
|
|
@@ -524,6 +524,30 @@
|
|
|
524
524
|
],
|
|
525
525
|
"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}"
|
|
526
526
|
},
|
|
527
|
+
{
|
|
528
|
+
"name": "CartAvailableShippingMethods",
|
|
529
|
+
"kind": "query",
|
|
530
|
+
"section": "Shipping Methods",
|
|
531
|
+
"description": "Cart-aware shipping methods discovery. Returns shipping methods available for the cart's contents at the given destination, with subtotal and physical-item weight pulled from the cart aggregate (no need to compute them client-side). When the cart contains only non-physical items (digital, gift card, service, subscription), the response is `methods: []` plus a `DIGITAL_ONLY_NO_SHIPPING` user error — use this as the signal to skip rendering the shipping picker step. Prefer this query over the standalone `AvailableShippingMethods` once a cart has been created (`cartCreate`). For pre-cart \"shipping cost preview\" UIs on product detail pages, the standalone query remains the right tool.",
|
|
532
|
+
"variables": [
|
|
533
|
+
{
|
|
534
|
+
"name": "cartId",
|
|
535
|
+
"type": "ID!",
|
|
536
|
+
"defaultValue": null
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"name": "address",
|
|
540
|
+
"type": "ShippingAddressInput!",
|
|
541
|
+
"defaultValue": null
|
|
542
|
+
}
|
|
543
|
+
],
|
|
544
|
+
"fragmentRefs": [
|
|
545
|
+
"AvailableShippingMethod",
|
|
546
|
+
"FreeShippingProgress",
|
|
547
|
+
"UserError"
|
|
548
|
+
],
|
|
549
|
+
"body": "query CartAvailableShippingMethods($cartId: ID!, $address: ShippingAddressInput!) {\n cart(id: $cartId) {\n id\n requiresShipping\n availableShippingMethods(address: $address) {\n methods {\n ...AvailableShippingMethod\n }\n freeShippingProgress {\n ...FreeShippingProgress\n }\n userErrors {\n ...UserError\n }\n }\n }\n}"
|
|
550
|
+
},
|
|
527
551
|
{
|
|
528
552
|
"name": "ProductFilters",
|
|
529
553
|
"kind": "query",
|
|
@@ -734,7 +758,7 @@
|
|
|
734
758
|
"name": "BlogPosts",
|
|
735
759
|
"kind": "query",
|
|
736
760
|
"section": "Blog",
|
|
737
|
-
"description": "Paginated list of published blog posts. Filter by `
|
|
761
|
+
"description": "Paginated list of published blog posts. Filter by `categoryHandle`, `tagHandle`, or `featured` (boolean flag, not enum). Sort: `PUBLISHED_AT` (default), `TITLE`, `VIEW_COUNT`, or `CREATED_AT`. Public; no auth required.",
|
|
738
762
|
"variables": [
|
|
739
763
|
{
|
|
740
764
|
"name": "first",
|
|
@@ -747,12 +771,12 @@
|
|
|
747
771
|
"defaultValue": null
|
|
748
772
|
},
|
|
749
773
|
{
|
|
750
|
-
"name": "
|
|
774
|
+
"name": "categoryHandle",
|
|
751
775
|
"type": "String",
|
|
752
776
|
"defaultValue": null
|
|
753
777
|
},
|
|
754
778
|
{
|
|
755
|
-
"name": "
|
|
779
|
+
"name": "tagHandle",
|
|
756
780
|
"type": "String",
|
|
757
781
|
"defaultValue": null
|
|
758
782
|
},
|
|
@@ -776,13 +800,13 @@
|
|
|
776
800
|
"BlogPost",
|
|
777
801
|
"PageInfo"
|
|
778
802
|
],
|
|
779
|
-
"body": "query BlogPosts($first: Int = 20, $after: String, $
|
|
803
|
+
"body": "query BlogPosts($first: Int = 20, $after: String, $categoryHandle: String, $tagHandle: String, $featured: Boolean, $sortKey: BlogPostSortKey = PUBLISHED_AT, $reverse: Boolean = false) {\n blogPosts(\n first: $first\n after: $after\n categoryHandle: $categoryHandle\n tagHandle: $tagHandle\n featured: $featured\n sortKey: $sortKey\n reverse: $reverse\n ) {\n edges {\n node {\n ...BlogPost\n }\n cursor\n }\n pageInfo {\n ...PageInfo\n }\n totalCount\n }\n}"
|
|
780
804
|
},
|
|
781
805
|
{
|
|
782
806
|
"name": "BlogPost",
|
|
783
807
|
"kind": "query",
|
|
784
808
|
"section": "Blog",
|
|
785
|
-
"description": "Fetches a single blog post by `id` or `
|
|
809
|
+
"description": "Fetches a single blog post by `id` or `handle`. Visibility-gated: returns null if the post is not yet `PUBLISHED` or if its publish date is in the future (scheduled posts stay hidden until their publish time). Side effect: fetching a post increments its `view_count` asynchronously (does not block the response).",
|
|
786
810
|
"variables": [
|
|
787
811
|
{
|
|
788
812
|
"name": "id",
|
|
@@ -790,7 +814,7 @@
|
|
|
790
814
|
"defaultValue": null
|
|
791
815
|
},
|
|
792
816
|
{
|
|
793
|
-
"name": "
|
|
817
|
+
"name": "handle",
|
|
794
818
|
"type": "String",
|
|
795
819
|
"defaultValue": null
|
|
796
820
|
}
|
|
@@ -798,7 +822,7 @@
|
|
|
798
822
|
"fragmentRefs": [
|
|
799
823
|
"BlogPost"
|
|
800
824
|
],
|
|
801
|
-
"body": "query BlogPost($id: ID, $
|
|
825
|
+
"body": "query BlogPost($id: ID, $handle: String) {\n blogPost(id: $id, handle: $handle) {\n ...BlogPost\n }\n}"
|
|
802
826
|
},
|
|
803
827
|
{
|
|
804
828
|
"name": "BlogCategories",
|
|
@@ -913,7 +937,7 @@
|
|
|
913
937
|
"name": "Menu",
|
|
914
938
|
"kind": "query",
|
|
915
939
|
"section": "Content: Navigation Menus",
|
|
916
|
-
"description": "Fetches a navigation menu by `handle` (e.g. `\"main-menu\"`, `\"footer\"`, `\"mobile\"`). Returns the nested item tree. Each item is typed as one of: `HTTP`, `FRONTPAGE`, `SEARCH`, `CATALOG`, `BLOG`, `PRODUCT`, `COLLECTION`, `CATEGORY`, or `
|
|
940
|
+
"description": "Fetches a navigation menu by `handle` (e.g. `\"main-menu\"`, `\"footer\"`, `\"mobile\"`). Returns the nested item tree (up to 3 levels). Each item is typed as one of: `HTTP`, `FRONTPAGE`, `SEARCH`, `CATALOG`, `BLOG`, `PRODUCT`, `COLLECTION`, `CATEGORY`, `PAGE`, or `BRAND` — switch on the type to render the right link target. Each resource-linked item exposes both a pre-resolved `url` (standard `/categories|/collections|/pages|/products|/brands/<handle>` convention) and a typed `resource` union with the raw handle so storefronts with custom routing can construct their own paths instead. All resource lookups are batched per request — no N+1 even for deep menus.",
|
|
917
941
|
"variables": [
|
|
918
942
|
{
|
|
919
943
|
"name": "handle",
|
|
@@ -1920,7 +1944,7 @@
|
|
|
1920
1944
|
"ImageCard",
|
|
1921
1945
|
"Money"
|
|
1922
1946
|
],
|
|
1923
|
-
"body": "fragment ProductCard on Product {\n id\n handle\n title\n vendor\n categories {\n id\n
|
|
1947
|
+
"body": "fragment ProductCard on Product {\n id\n handle\n title\n vendor\n categories {\n id\n handle\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}",
|
|
1924
1948
|
"onType": "Product"
|
|
1925
1949
|
},
|
|
1926
1950
|
{
|
|
@@ -1966,12 +1990,12 @@
|
|
|
1966
1990
|
"name": "Category",
|
|
1967
1991
|
"kind": "fragment",
|
|
1968
1992
|
"section": "Categories",
|
|
1969
|
-
"description": "Category node in the shop's taxonomy — name,
|
|
1993
|
+
"description": "Category node in the shop's taxonomy — name, handle, hero image, depth `level`, materialized `path`, product count, sort order. Spread on category cards and breadcrumb segments. Does NOT include parent / children — query those fields separately and let the server batch them.",
|
|
1970
1994
|
"variables": [],
|
|
1971
1995
|
"fragmentRefs": [
|
|
1972
1996
|
"ImageCard"
|
|
1973
1997
|
],
|
|
1974
|
-
"body": "fragment Category on Category {\n id\n name\n
|
|
1998
|
+
"body": "fragment Category on Category {\n id\n name\n handle\n description\n image {\n ...ImageCard\n }\n level\n path\n productCount\n sortOrder\n}",
|
|
1975
1999
|
"onType": "Category"
|
|
1976
2000
|
},
|
|
1977
2001
|
{
|
|
@@ -2065,7 +2089,7 @@
|
|
|
2065
2089
|
"CartLineCost",
|
|
2066
2090
|
"ProductVariant"
|
|
2067
2091
|
],
|
|
2068
|
-
"body": "fragment CartLine on CartLine {\n id\n quantity\n variant {\n ...ProductVariant\n }\n cost {\n ...CartLineCost\n }\n attributes {\n key\n value\n }\n attributeSelections {\n ...AttributeSelection\n }\n productId\n productTitle\n productHandle\n productType\n}",
|
|
2092
|
+
"body": "fragment CartLine on CartLine {\n id\n quantity\n variant {\n ...ProductVariant\n }\n cost {\n ...CartLineCost\n }\n attributes {\n key\n value\n }\n attributeSelections {\n ...AttributeSelection\n }\n productId\n productTitle\n productHandle\n productType\n requiresShipping\n}",
|
|
2069
2093
|
"onType": "CartLine"
|
|
2070
2094
|
},
|
|
2071
2095
|
{
|
|
@@ -2118,7 +2142,7 @@
|
|
|
2118
2142
|
"MailingAddress",
|
|
2119
2143
|
"PageInfo"
|
|
2120
2144
|
],
|
|
2121
|
-
"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 createdAt\n updatedAt\n}",
|
|
2145
|
+
"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}",
|
|
2122
2146
|
"onType": "Cart"
|
|
2123
2147
|
},
|
|
2124
2148
|
{
|
|
@@ -2547,10 +2571,10 @@
|
|
|
2547
2571
|
"name": "CategoryFilterOption",
|
|
2548
2572
|
"kind": "fragment",
|
|
2549
2573
|
"section": "Attribute Filters",
|
|
2550
|
-
"description": "One category option in the categories filter — id, name,
|
|
2574
|
+
"description": "One category option in the categories filter — id, name, handle, count of products in this category within the current listing context, level + parentId for tree rendering.",
|
|
2551
2575
|
"variables": [],
|
|
2552
2576
|
"fragmentRefs": [],
|
|
2553
|
-
"body": "fragment CategoryFilterOption on CategoryFilterOption {\n id\n name\n
|
|
2577
|
+
"body": "fragment CategoryFilterOption on CategoryFilterOption {\n id\n name\n handle\n productCount\n level\n parentId\n}",
|
|
2554
2578
|
"onType": "CategoryFilterOption"
|
|
2555
2579
|
},
|
|
2556
2580
|
{
|
|
@@ -2648,7 +2672,7 @@
|
|
|
2648
2672
|
"LoyaltyTier",
|
|
2649
2673
|
"Money"
|
|
2650
2674
|
],
|
|
2651
|
-
"body": "fragment LoyaltyReward on LoyaltyReward {\n id\n name\n
|
|
2675
|
+
"body": "fragment LoyaltyReward on LoyaltyReward {\n id\n name\n handle\n type\n pointsCost\n discountPercent\n discountAmount {\n ...Money\n }\n description\n image {\n ...ImageCard\n }\n isAvailable\n tierRequired {\n ...LoyaltyTier\n }\n redemptionsRemaining\n}",
|
|
2652
2676
|
"onType": "LoyaltyReward"
|
|
2653
2677
|
},
|
|
2654
2678
|
{
|
|
@@ -2766,27 +2790,27 @@
|
|
|
2766
2790
|
"name": "BlogCategory",
|
|
2767
2791
|
"kind": "fragment",
|
|
2768
2792
|
"section": "Blog",
|
|
2769
|
-
"description": "Blog category — name,
|
|
2793
|
+
"description": "Blog category — name, handle, description, post count. Spread on category navigation and post category labels.",
|
|
2770
2794
|
"variables": [],
|
|
2771
2795
|
"fragmentRefs": [],
|
|
2772
|
-
"body": "fragment BlogCategory on BlogCategory {\n id\n name\n
|
|
2796
|
+
"body": "fragment BlogCategory on BlogCategory {\n id\n name\n handle\n description\n postCount\n}",
|
|
2773
2797
|
"onType": "BlogCategory"
|
|
2774
2798
|
},
|
|
2775
2799
|
{
|
|
2776
2800
|
"name": "BlogTag",
|
|
2777
2801
|
"kind": "fragment",
|
|
2778
2802
|
"section": "Blog",
|
|
2779
|
-
"description": "Blog tag — name,
|
|
2803
|
+
"description": "Blog tag — name, handle, post count. Spread on tag clouds and post tag labels.",
|
|
2780
2804
|
"variables": [],
|
|
2781
2805
|
"fragmentRefs": [],
|
|
2782
|
-
"body": "fragment BlogTag on BlogTag {\n id\n name\n
|
|
2806
|
+
"body": "fragment BlogTag on BlogTag {\n id\n name\n handle\n postCount\n}",
|
|
2783
2807
|
"onType": "BlogTag"
|
|
2784
2808
|
},
|
|
2785
2809
|
{
|
|
2786
2810
|
"name": "BlogPost",
|
|
2787
2811
|
"kind": "fragment",
|
|
2788
2812
|
"section": "Blog",
|
|
2789
|
-
"description": "Full blog post — title,
|
|
2813
|
+
"description": "Full blog post — title, handle, 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.",
|
|
2790
2814
|
"variables": [],
|
|
2791
2815
|
"fragmentRefs": [
|
|
2792
2816
|
"BlogCategory",
|
|
@@ -2794,7 +2818,7 @@
|
|
|
2794
2818
|
"ImageCard",
|
|
2795
2819
|
"ImageThumbnail"
|
|
2796
2820
|
],
|
|
2797
|
-
"body": "fragment BlogPost on BlogPost {\n id\n title\n
|
|
2821
|
+
"body": "fragment BlogPost on BlogPost {\n id\n title\n handle\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}",
|
|
2798
2822
|
"onType": "BlogPost"
|
|
2799
2823
|
},
|
|
2800
2824
|
{
|
|
@@ -2883,7 +2907,7 @@
|
|
|
2883
2907
|
"name": "ShopPage",
|
|
2884
2908
|
"kind": "fragment",
|
|
2885
2909
|
"section": "Pages",
|
|
2886
|
-
"description": "CMS page — handle (URL
|
|
2910
|
+
"description": "CMS page — handle (URL-friendly identifier), title, body (HTML), excerpt, SEO metadata, publish date. Spread on About / Privacy / Terms / Returns Policy pages.",
|
|
2887
2911
|
"variables": [],
|
|
2888
2912
|
"fragmentRefs": [],
|
|
2889
2913
|
"body": "fragment ShopPage on ShopPage {\n id\n handle\n title\n body\n excerpt\n seo {\n title\n description\n }\n publishedAt\n createdAt\n updatedAt\n}",
|
|
@@ -2893,12 +2917,12 @@
|
|
|
2893
2917
|
"name": "MenuItem",
|
|
2894
2918
|
"kind": "fragment",
|
|
2895
2919
|
"section": "Navigation Menus",
|
|
2896
|
-
"description": "One menu item with up to 3 levels of nested children — title, URL, type (`HTTP` / `FRONTPAGE` / `SEARCH` / `CATALOG` / `BLOG` / `PRODUCT` / `COLLECTION` / `CATEGORY` / `PAGE`), `resourceId` for typed items, optional image. Switch on `type` to
|
|
2920
|
+
"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.",
|
|
2897
2921
|
"variables": [],
|
|
2898
2922
|
"fragmentRefs": [
|
|
2899
2923
|
"Image"
|
|
2900
2924
|
],
|
|
2901
|
-
"body": "fragment MenuItem on MenuItem {\n id\n title\n url\n type\n resourceId\n image {\n ...Image\n }\n items {\n id\n title\n url\n type\n resourceId\n items {\n id\n title\n url\n type\n resourceId\n }\n }\n}",
|
|
2925
|
+
"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}",
|
|
2902
2926
|
"onType": "MenuItem"
|
|
2903
2927
|
},
|
|
2904
2928
|
{
|
|
@@ -2954,7 +2978,7 @@
|
|
|
2954
2978
|
"fragmentRefs": [
|
|
2955
2979
|
"ProductAttributeOption"
|
|
2956
2980
|
],
|
|
2957
|
-
"body": "fragment ProductAttributeDefinition on ProductAttributeDefinition {\n id\n name\n
|
|
2981
|
+
"body": "fragment ProductAttributeDefinition on ProductAttributeDefinition {\n id\n name\n handle\n description\n type\n fillingMode\n billingMode\n taxClassId\n scopeProductId\n isRequired\n isVisible\n displayOrder\n minValue\n maxValue\n options {\n ...ProductAttributeOption\n }\n}",
|
|
2958
2982
|
"onType": "ProductAttributeDefinition"
|
|
2959
2983
|
}
|
|
2960
2984
|
]
|
package/package.json
CHANGED
package/queries.graphql
CHANGED
|
@@ -18,7 +18,7 @@ query Shop {
|
|
|
18
18
|
# Products
|
|
19
19
|
# ============================================
|
|
20
20
|
|
|
21
|
-
# Fetches a single product by `id` or `handle` (URL
|
|
21
|
+
# Fetches a single product by `id` or `handle` (URL-friendly identifier). Pass either — whichever is provided wins; if both are missing, returns null. Returns null if the product is not storefront-accessible (must be `ACTIVE` status with `PUBLIC` or `BUNDLE_ONLY` visibility).
|
|
22
22
|
query Product($id: ID, $handle: String) {
|
|
23
23
|
product(id: $id, handle: $handle) {
|
|
24
24
|
...ProductFull
|
|
@@ -139,9 +139,9 @@ query Collections($first: Int = 20, $after: String, $query: String, $sortKey: Co
|
|
|
139
139
|
# Categories
|
|
140
140
|
# ============================================
|
|
141
141
|
|
|
142
|
-
# Fetches a single category by `id` or `
|
|
143
|
-
query Category($id: ID, $
|
|
144
|
-
category(id: $id,
|
|
142
|
+
# Fetches a single category by `id` or `handle` 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.
|
|
143
|
+
query Category($id: ID, $handle: String) {
|
|
144
|
+
category(id: $id, handle: $handle) {
|
|
145
145
|
...Category
|
|
146
146
|
parent {
|
|
147
147
|
...Category
|
|
@@ -368,7 +368,7 @@ query GiftCardValidate($code: String!, $amount: Float) {
|
|
|
368
368
|
# Shipping Methods
|
|
369
369
|
# ============================================
|
|
370
370
|
|
|
371
|
-
# Returns shipping methods for a given destination address and cart shape (subtotal, total weight, currency). The query computes everything from the inputs alone — no existing cart is required, so it can be used for "shipping cost preview" UIs before the customer adds anything to a cart. Each method includes price, free-shipping progress (`{ qualifies, currentAmount, threshold, remaining, progressPercent }`), estimated delivery, and carrier metadata. Sorted by the merchant's `sortOrder`, then by price.
|
|
371
|
+
# Returns shipping methods for a given destination address and cart shape (subtotal, total weight, currency). The query computes everything from the inputs alone — no existing cart is required, so it can be used for "shipping cost preview" UIs (e.g. product detail page shipping calculator) before the customer adds anything to a cart. Each method includes price, free-shipping progress (`{ qualifies, currentAmount, threshold, remaining, progressPercent }`), estimated delivery, and carrier metadata. Sorted by the merchant's `sortOrder`, then by price. For a cart-bound checkout flow (where the cart is already known and the storefront wants the resolver to skip non-physical items and surface a `DIGITAL_ONLY_NO_SHIPPING` user error for all-digital carts), use `CartAvailableShippingMethods` against `cart.availableShippingMethods(address)` instead.
|
|
372
372
|
query AvailableShippingMethods($address: ShippingAddressInput!, $cart: CartShippingInput) {
|
|
373
373
|
availableShippingMethods(address: $address, cart: $cart) {
|
|
374
374
|
methods {
|
|
@@ -383,6 +383,25 @@ query AvailableShippingMethods($address: ShippingAddressInput!, $cart: CartShipp
|
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
|
|
386
|
+
# Cart-aware shipping methods discovery. Returns shipping methods available for the cart's contents at the given destination, with subtotal and physical-item weight pulled from the cart aggregate (no need to compute them client-side). When the cart contains only non-physical items (digital, gift card, service, subscription), the response is `methods: []` plus a `DIGITAL_ONLY_NO_SHIPPING` user error — use this as the signal to skip rendering the shipping picker step. Prefer this query over the standalone `AvailableShippingMethods` once a cart has been created (`cartCreate`). For pre-cart "shipping cost preview" UIs on product detail pages, the standalone query remains the right tool.
|
|
387
|
+
query CartAvailableShippingMethods($cartId: ID!, $address: ShippingAddressInput!) {
|
|
388
|
+
cart(id: $cartId) {
|
|
389
|
+
id
|
|
390
|
+
requiresShipping
|
|
391
|
+
availableShippingMethods(address: $address) {
|
|
392
|
+
methods {
|
|
393
|
+
...AvailableShippingMethod
|
|
394
|
+
}
|
|
395
|
+
freeShippingProgress {
|
|
396
|
+
...FreeShippingProgress
|
|
397
|
+
}
|
|
398
|
+
userErrors {
|
|
399
|
+
...UserError
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
386
405
|
# ============================================
|
|
387
406
|
# Attribute Filters
|
|
388
407
|
# ============================================
|
|
@@ -520,9 +539,9 @@ query WishlistById($id: ID!) {
|
|
|
520
539
|
# Blog
|
|
521
540
|
# ============================================
|
|
522
541
|
|
|
523
|
-
# Paginated list of published blog posts. Filter by `
|
|
524
|
-
query BlogPosts($first: Int = 20, $after: String, $
|
|
525
|
-
blogPosts(first: $first, after: $after,
|
|
542
|
+
# Paginated list of published blog posts. Filter by `categoryHandle`, `tagHandle`, or `featured` (boolean flag, not enum). Sort: `PUBLISHED_AT` (default), `TITLE`, `VIEW_COUNT`, or `CREATED_AT`. Public; no auth required.
|
|
543
|
+
query BlogPosts($first: Int = 20, $after: String, $categoryHandle: String, $tagHandle: String, $featured: Boolean, $sortKey: BlogPostSortKey = PUBLISHED_AT, $reverse: Boolean = false) {
|
|
544
|
+
blogPosts(first: $first, after: $after, categoryHandle: $categoryHandle, tagHandle: $tagHandle, featured: $featured, sortKey: $sortKey, reverse: $reverse) {
|
|
526
545
|
edges {
|
|
527
546
|
node {
|
|
528
547
|
...BlogPost
|
|
@@ -536,9 +555,9 @@ query BlogPosts($first: Int = 20, $after: String, $categorySlug: String, $tagSlu
|
|
|
536
555
|
}
|
|
537
556
|
}
|
|
538
557
|
|
|
539
|
-
# Fetches a single blog post by `id` or `
|
|
540
|
-
query BlogPost($id: ID, $
|
|
541
|
-
blogPost(id: $id,
|
|
558
|
+
# Fetches a single blog post by `id` or `handle`. Visibility-gated: returns null if the post is not yet `PUBLISHED` or if its publish date is in the future (scheduled posts stay hidden until their publish time). Side effect: fetching a post increments its `view_count` asynchronously (does not block the response).
|
|
559
|
+
query BlogPost($id: ID, $handle: String) {
|
|
560
|
+
blogPost(id: $id, handle: $handle) {
|
|
542
561
|
...BlogPost
|
|
543
562
|
}
|
|
544
563
|
}
|
|
@@ -599,7 +618,7 @@ query Pages($first: Int = 20, $after: String, $sortKey: PageSortKeys = TITLE, $r
|
|
|
599
618
|
# Content: Navigation Menus
|
|
600
619
|
# ============================================
|
|
601
620
|
|
|
602
|
-
# Fetches a navigation menu by `handle` (e.g. `"main-menu"`, `"footer"`, `"mobile"`). Returns the nested item tree. Each item is typed as one of: `HTTP`, `FRONTPAGE`, `SEARCH`, `CATALOG`, `BLOG`, `PRODUCT`, `COLLECTION`, `CATEGORY`, or `
|
|
621
|
+
# Fetches a navigation menu by `handle` (e.g. `"main-menu"`, `"footer"`, `"mobile"`). Returns the nested item tree (up to 3 levels). Each item is typed as one of: `HTTP`, `FRONTPAGE`, `SEARCH`, `CATALOG`, `BLOG`, `PRODUCT`, `COLLECTION`, `CATEGORY`, `PAGE`, or `BRAND` — switch on the type to render the right link target. Each resource-linked item exposes both a pre-resolved `url` (standard `/categories|/collections|/pages|/products|/brands/<handle>` convention) and a typed `resource` union with the raw handle so storefronts with custom routing can construct their own paths instead. All resource lookups are batched per request — no N+1 even for deep menus.
|
|
603
622
|
query Menu($handle: String!) {
|
|
604
623
|
menu(handle: $handle) {
|
|
605
624
|
...Menu
|