@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/llms-full.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# DoSwiftly Storefront Operations — Full Reference
|
|
2
2
|
|
|
3
|
-
> Schema version: **
|
|
4
|
-
>
|
|
3
|
+
> Schema version: **14.0.0**
|
|
4
|
+
> 50 queries · 40 mutations · 100 fragments
|
|
5
5
|
|
|
6
6
|
Auto-generated from `.graphql` source files. Do not edit by hand — this file is
|
|
7
7
|
regenerated on every release to match the published schema.
|
|
@@ -41,7 +41,7 @@ query Shop {
|
|
|
41
41
|
|
|
42
42
|
**Section**: Products
|
|
43
43
|
|
|
44
|
-
**Description**: Fetches a single product by `id` or `handle` (URL
|
|
44
|
+
**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).
|
|
45
45
|
|
|
46
46
|
**Variables**:
|
|
47
47
|
- `$id`: `ID`
|
|
@@ -274,18 +274,18 @@ query Collections($first: Int = 20, $after: String, $query: String, $sortKey: Co
|
|
|
274
274
|
|
|
275
275
|
**Section**: Categories
|
|
276
276
|
|
|
277
|
-
**Description**: Fetches a single category by `id` or `
|
|
277
|
+
**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.
|
|
278
278
|
|
|
279
279
|
**Variables**:
|
|
280
280
|
- `$id`: `ID`
|
|
281
|
-
- `$
|
|
281
|
+
- `$handle`: `String`
|
|
282
282
|
|
|
283
283
|
**Fragments used**: `Category`
|
|
284
284
|
|
|
285
285
|
**GraphQL**:
|
|
286
286
|
```graphql
|
|
287
|
-
query Category($id: ID, $
|
|
288
|
-
category(id: $id,
|
|
287
|
+
query Category($id: ID, $handle: String) {
|
|
288
|
+
category(id: $id, handle: $handle) {
|
|
289
289
|
...Category
|
|
290
290
|
parent {
|
|
291
291
|
...Category
|
|
@@ -676,7 +676,7 @@ query GiftCardValidate($code: String!, $amount: Float) {
|
|
|
676
676
|
|
|
677
677
|
**Section**: Shipping Methods
|
|
678
678
|
|
|
679
|
-
**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.
|
|
679
|
+
**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.
|
|
680
680
|
|
|
681
681
|
**Variables**:
|
|
682
682
|
- `$address`: `ShippingAddressInput!`
|
|
@@ -701,6 +701,39 @@ query AvailableShippingMethods($address: ShippingAddressInput!, $cart: CartShipp
|
|
|
701
701
|
}
|
|
702
702
|
```
|
|
703
703
|
|
|
704
|
+
### Query: `CartAvailableShippingMethods`
|
|
705
|
+
|
|
706
|
+
**Section**: Shipping Methods
|
|
707
|
+
|
|
708
|
+
**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.
|
|
709
|
+
|
|
710
|
+
**Variables**:
|
|
711
|
+
- `$cartId`: `ID!`
|
|
712
|
+
- `$address`: `ShippingAddressInput!`
|
|
713
|
+
|
|
714
|
+
**Fragments used**: `AvailableShippingMethod`, `FreeShippingProgress`, `UserError`
|
|
715
|
+
|
|
716
|
+
**GraphQL**:
|
|
717
|
+
```graphql
|
|
718
|
+
query CartAvailableShippingMethods($cartId: ID!, $address: ShippingAddressInput!) {
|
|
719
|
+
cart(id: $cartId) {
|
|
720
|
+
id
|
|
721
|
+
requiresShipping
|
|
722
|
+
availableShippingMethods(address: $address) {
|
|
723
|
+
methods {
|
|
724
|
+
...AvailableShippingMethod
|
|
725
|
+
}
|
|
726
|
+
freeShippingProgress {
|
|
727
|
+
...FreeShippingProgress
|
|
728
|
+
}
|
|
729
|
+
userErrors {
|
|
730
|
+
...UserError
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
```
|
|
736
|
+
|
|
704
737
|
### Query: `ProductFilters`
|
|
705
738
|
|
|
706
739
|
**Section**: Attribute Filters
|
|
@@ -985,13 +1018,13 @@ query WishlistById($id: ID!) {
|
|
|
985
1018
|
|
|
986
1019
|
**Section**: Blog
|
|
987
1020
|
|
|
988
|
-
**Description**: Paginated list of published blog posts. Filter by `
|
|
1021
|
+
**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.
|
|
989
1022
|
|
|
990
1023
|
**Variables**:
|
|
991
1024
|
- `$first`: `Int` *(default: `20`)*
|
|
992
1025
|
- `$after`: `String`
|
|
993
|
-
- `$
|
|
994
|
-
- `$
|
|
1026
|
+
- `$categoryHandle`: `String`
|
|
1027
|
+
- `$tagHandle`: `String`
|
|
995
1028
|
- `$featured`: `Boolean`
|
|
996
1029
|
- `$sortKey`: `BlogPostSortKey` *(default: `PUBLISHED_AT`)*
|
|
997
1030
|
- `$reverse`: `Boolean` *(default: `false`)*
|
|
@@ -1000,12 +1033,12 @@ query WishlistById($id: ID!) {
|
|
|
1000
1033
|
|
|
1001
1034
|
**GraphQL**:
|
|
1002
1035
|
```graphql
|
|
1003
|
-
query BlogPosts($first: Int = 20, $after: String, $
|
|
1036
|
+
query BlogPosts($first: Int = 20, $after: String, $categoryHandle: String, $tagHandle: String, $featured: Boolean, $sortKey: BlogPostSortKey = PUBLISHED_AT, $reverse: Boolean = false) {
|
|
1004
1037
|
blogPosts(
|
|
1005
1038
|
first: $first
|
|
1006
1039
|
after: $after
|
|
1007
|
-
|
|
1008
|
-
|
|
1040
|
+
categoryHandle: $categoryHandle
|
|
1041
|
+
tagHandle: $tagHandle
|
|
1009
1042
|
featured: $featured
|
|
1010
1043
|
sortKey: $sortKey
|
|
1011
1044
|
reverse: $reverse
|
|
@@ -1028,18 +1061,18 @@ query BlogPosts($first: Int = 20, $after: String, $categorySlug: String, $tagSlu
|
|
|
1028
1061
|
|
|
1029
1062
|
**Section**: Blog
|
|
1030
1063
|
|
|
1031
|
-
**Description**: Fetches a single blog post by `id` or `
|
|
1064
|
+
**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).
|
|
1032
1065
|
|
|
1033
1066
|
**Variables**:
|
|
1034
1067
|
- `$id`: `ID`
|
|
1035
|
-
- `$
|
|
1068
|
+
- `$handle`: `String`
|
|
1036
1069
|
|
|
1037
1070
|
**Fragments used**: `BlogPost`
|
|
1038
1071
|
|
|
1039
1072
|
**GraphQL**:
|
|
1040
1073
|
```graphql
|
|
1041
|
-
query BlogPost($id: ID, $
|
|
1042
|
-
blogPost(id: $id,
|
|
1074
|
+
query BlogPost($id: ID, $handle: String) {
|
|
1075
|
+
blogPost(id: $id, handle: $handle) {
|
|
1043
1076
|
...BlogPost
|
|
1044
1077
|
}
|
|
1045
1078
|
}
|
|
@@ -1169,7 +1202,7 @@ query Pages($first: Int = 20, $after: String, $sortKey: PageSortKeys = TITLE, $r
|
|
|
1169
1202
|
|
|
1170
1203
|
**Section**: Content: Navigation Menus
|
|
1171
1204
|
|
|
1172
|
-
**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 `
|
|
1205
|
+
**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.
|
|
1173
1206
|
|
|
1174
1207
|
**Variables**:
|
|
1175
1208
|
- `$handle`: `String!`
|
|
@@ -2557,7 +2590,7 @@ fragment ProductCard on Product {
|
|
|
2557
2590
|
vendor
|
|
2558
2591
|
categories {
|
|
2559
2592
|
id
|
|
2560
|
-
|
|
2593
|
+
handle
|
|
2561
2594
|
name
|
|
2562
2595
|
}
|
|
2563
2596
|
isAvailable
|
|
@@ -2690,7 +2723,7 @@ fragment Collection on Collection {
|
|
|
2690
2723
|
|
|
2691
2724
|
**Section**: Categories
|
|
2692
2725
|
|
|
2693
|
-
**Description**: Category node in the shop's taxonomy — name,
|
|
2726
|
+
**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.
|
|
2694
2727
|
|
|
2695
2728
|
**Uses fragments**: `ImageCard`
|
|
2696
2729
|
|
|
@@ -2699,7 +2732,7 @@ fragment Collection on Collection {
|
|
|
2699
2732
|
fragment Category on Category {
|
|
2700
2733
|
id
|
|
2701
2734
|
name
|
|
2702
|
-
|
|
2735
|
+
handle
|
|
2703
2736
|
description
|
|
2704
2737
|
image {
|
|
2705
2738
|
...ImageCard
|
|
@@ -2943,6 +2976,7 @@ fragment CartLine on CartLine {
|
|
|
2943
2976
|
productTitle
|
|
2944
2977
|
productHandle
|
|
2945
2978
|
productType
|
|
2979
|
+
requiresShipping
|
|
2946
2980
|
}
|
|
2947
2981
|
```
|
|
2948
2982
|
|
|
@@ -3060,6 +3094,7 @@ fragment Cart on Cart {
|
|
|
3060
3094
|
appliedGiftCards {
|
|
3061
3095
|
...CartAppliedGiftCard
|
|
3062
3096
|
}
|
|
3097
|
+
requiresShipping
|
|
3063
3098
|
createdAt
|
|
3064
3099
|
updatedAt
|
|
3065
3100
|
}
|
|
@@ -3869,14 +3904,14 @@ fragment PriceRangeFilter on PriceRange {
|
|
|
3869
3904
|
|
|
3870
3905
|
**Section**: Attribute Filters
|
|
3871
3906
|
|
|
3872
|
-
**Description**: One category option in the categories filter — id, name,
|
|
3907
|
+
**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.
|
|
3873
3908
|
|
|
3874
3909
|
**GraphQL**:
|
|
3875
3910
|
```graphql
|
|
3876
3911
|
fragment CategoryFilterOption on CategoryFilterOption {
|
|
3877
3912
|
id
|
|
3878
3913
|
name
|
|
3879
|
-
|
|
3914
|
+
handle
|
|
3880
3915
|
productCount
|
|
3881
3916
|
level
|
|
3882
3917
|
parentId
|
|
@@ -4059,7 +4094,7 @@ fragment LoyaltyTransaction on LoyaltyTransaction {
|
|
|
4059
4094
|
fragment LoyaltyReward on LoyaltyReward {
|
|
4060
4095
|
id
|
|
4061
4096
|
name
|
|
4062
|
-
|
|
4097
|
+
handle
|
|
4063
4098
|
type
|
|
4064
4099
|
pointsCost
|
|
4065
4100
|
discountPercent
|
|
@@ -4292,14 +4327,14 @@ fragment Wishlist on Wishlist {
|
|
|
4292
4327
|
|
|
4293
4328
|
**Section**: Blog
|
|
4294
4329
|
|
|
4295
|
-
**Description**: Blog category — name,
|
|
4330
|
+
**Description**: Blog category — name, handle, description, post count. Spread on category navigation and post category labels.
|
|
4296
4331
|
|
|
4297
4332
|
**GraphQL**:
|
|
4298
4333
|
```graphql
|
|
4299
4334
|
fragment BlogCategory on BlogCategory {
|
|
4300
4335
|
id
|
|
4301
4336
|
name
|
|
4302
|
-
|
|
4337
|
+
handle
|
|
4303
4338
|
description
|
|
4304
4339
|
postCount
|
|
4305
4340
|
}
|
|
@@ -4309,14 +4344,14 @@ fragment BlogCategory on BlogCategory {
|
|
|
4309
4344
|
|
|
4310
4345
|
**Section**: Blog
|
|
4311
4346
|
|
|
4312
|
-
**Description**: Blog tag — name,
|
|
4347
|
+
**Description**: Blog tag — name, handle, post count. Spread on tag clouds and post tag labels.
|
|
4313
4348
|
|
|
4314
4349
|
**GraphQL**:
|
|
4315
4350
|
```graphql
|
|
4316
4351
|
fragment BlogTag on BlogTag {
|
|
4317
4352
|
id
|
|
4318
4353
|
name
|
|
4319
|
-
|
|
4354
|
+
handle
|
|
4320
4355
|
postCount
|
|
4321
4356
|
}
|
|
4322
4357
|
```
|
|
@@ -4325,7 +4360,7 @@ fragment BlogTag on BlogTag {
|
|
|
4325
4360
|
|
|
4326
4361
|
**Section**: Blog
|
|
4327
4362
|
|
|
4328
|
-
**Description**: Full blog post — title,
|
|
4363
|
+
**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.
|
|
4329
4364
|
|
|
4330
4365
|
**Uses fragments**: `BlogCategory`, `BlogTag`, `ImageCard`, `ImageThumbnail`
|
|
4331
4366
|
|
|
@@ -4334,7 +4369,7 @@ fragment BlogTag on BlogTag {
|
|
|
4334
4369
|
fragment BlogPost on BlogPost {
|
|
4335
4370
|
id
|
|
4336
4371
|
title
|
|
4337
|
-
|
|
4372
|
+
handle
|
|
4338
4373
|
excerpt
|
|
4339
4374
|
content
|
|
4340
4375
|
contentFormat
|
|
@@ -4540,7 +4575,7 @@ fragment VariantStoreAvailability on ProductVariant {
|
|
|
4540
4575
|
|
|
4541
4576
|
**Section**: Pages
|
|
4542
4577
|
|
|
4543
|
-
**Description**: CMS page — handle (URL
|
|
4578
|
+
**Description**: CMS page — handle (URL-friendly identifier), title, body (HTML), excerpt, SEO metadata, publish date. Spread on About / Privacy / Terms / Returns Policy pages.
|
|
4544
4579
|
|
|
4545
4580
|
**GraphQL**:
|
|
4546
4581
|
```graphql
|
|
@@ -4564,7 +4599,7 @@ fragment ShopPage on ShopPage {
|
|
|
4564
4599
|
|
|
4565
4600
|
**Section**: Navigation Menus
|
|
4566
4601
|
|
|
4567
|
-
**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
|
|
4602
|
+
**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.
|
|
4568
4603
|
|
|
4569
4604
|
**Uses fragments**: `Image`
|
|
4570
4605
|
|
|
@@ -4576,6 +4611,35 @@ fragment MenuItem on MenuItem {
|
|
|
4576
4611
|
url
|
|
4577
4612
|
type
|
|
4578
4613
|
resourceId
|
|
4614
|
+
resource {
|
|
4615
|
+
__typename
|
|
4616
|
+
... on Category {
|
|
4617
|
+
id
|
|
4618
|
+
handle
|
|
4619
|
+
name
|
|
4620
|
+
}
|
|
4621
|
+
... on Collection {
|
|
4622
|
+
id
|
|
4623
|
+
handle
|
|
4624
|
+
title
|
|
4625
|
+
}
|
|
4626
|
+
... on ShopPage {
|
|
4627
|
+
id
|
|
4628
|
+
handle
|
|
4629
|
+
title
|
|
4630
|
+
}
|
|
4631
|
+
... on Product {
|
|
4632
|
+
id
|
|
4633
|
+
handle
|
|
4634
|
+
title
|
|
4635
|
+
}
|
|
4636
|
+
... on Brand {
|
|
4637
|
+
id
|
|
4638
|
+
handle
|
|
4639
|
+
name
|
|
4640
|
+
logo
|
|
4641
|
+
}
|
|
4642
|
+
}
|
|
4579
4643
|
image {
|
|
4580
4644
|
...Image
|
|
4581
4645
|
}
|
|
@@ -4585,12 +4649,70 @@ fragment MenuItem on MenuItem {
|
|
|
4585
4649
|
url
|
|
4586
4650
|
type
|
|
4587
4651
|
resourceId
|
|
4652
|
+
resource {
|
|
4653
|
+
__typename
|
|
4654
|
+
... on Category {
|
|
4655
|
+
id
|
|
4656
|
+
handle
|
|
4657
|
+
name
|
|
4658
|
+
}
|
|
4659
|
+
... on Collection {
|
|
4660
|
+
id
|
|
4661
|
+
handle
|
|
4662
|
+
title
|
|
4663
|
+
}
|
|
4664
|
+
... on ShopPage {
|
|
4665
|
+
id
|
|
4666
|
+
handle
|
|
4667
|
+
title
|
|
4668
|
+
}
|
|
4669
|
+
... on Product {
|
|
4670
|
+
id
|
|
4671
|
+
handle
|
|
4672
|
+
title
|
|
4673
|
+
}
|
|
4674
|
+
... on Brand {
|
|
4675
|
+
id
|
|
4676
|
+
handle
|
|
4677
|
+
name
|
|
4678
|
+
logo
|
|
4679
|
+
}
|
|
4680
|
+
}
|
|
4588
4681
|
items {
|
|
4589
4682
|
id
|
|
4590
4683
|
title
|
|
4591
4684
|
url
|
|
4592
4685
|
type
|
|
4593
4686
|
resourceId
|
|
4687
|
+
resource {
|
|
4688
|
+
__typename
|
|
4689
|
+
... on Category {
|
|
4690
|
+
id
|
|
4691
|
+
handle
|
|
4692
|
+
name
|
|
4693
|
+
}
|
|
4694
|
+
... on Collection {
|
|
4695
|
+
id
|
|
4696
|
+
handle
|
|
4697
|
+
title
|
|
4698
|
+
}
|
|
4699
|
+
... on ShopPage {
|
|
4700
|
+
id
|
|
4701
|
+
handle
|
|
4702
|
+
title
|
|
4703
|
+
}
|
|
4704
|
+
... on Product {
|
|
4705
|
+
id
|
|
4706
|
+
handle
|
|
4707
|
+
title
|
|
4708
|
+
}
|
|
4709
|
+
... on Brand {
|
|
4710
|
+
id
|
|
4711
|
+
handle
|
|
4712
|
+
name
|
|
4713
|
+
logo
|
|
4714
|
+
}
|
|
4715
|
+
}
|
|
4594
4716
|
}
|
|
4595
4717
|
}
|
|
4596
4718
|
}
|
|
@@ -4688,7 +4810,7 @@ fragment ProductAttributeOption on ProductAttributeOption {
|
|
|
4688
4810
|
fragment ProductAttributeDefinition on ProductAttributeDefinition {
|
|
4689
4811
|
id
|
|
4690
4812
|
name
|
|
4691
|
-
|
|
4813
|
+
handle
|
|
4692
4814
|
description
|
|
4693
4815
|
type
|
|
4694
4816
|
fillingMode
|