@clawpify/skills 1.0.1
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/LICENSE +21 -0
- package/README.md +73 -0
- package/clawpify/SKILL.md +134 -0
- package/clawpify/references/blogs.md +385 -0
- package/clawpify/references/bulk-operations.md +386 -0
- package/clawpify/references/collections.md +71 -0
- package/clawpify/references/customers.md +141 -0
- package/clawpify/references/discounts.md +431 -0
- package/clawpify/references/draft-orders.md +495 -0
- package/clawpify/references/files.md +355 -0
- package/clawpify/references/fulfillments.md +437 -0
- package/clawpify/references/gift-cards.md +453 -0
- package/clawpify/references/inventory.md +107 -0
- package/clawpify/references/locations.md +349 -0
- package/clawpify/references/marketing.md +352 -0
- package/clawpify/references/markets.md +346 -0
- package/clawpify/references/menus.md +313 -0
- package/clawpify/references/metafields.md +461 -0
- package/clawpify/references/orders.md +164 -0
- package/clawpify/references/pages.md +308 -0
- package/clawpify/references/products.md +277 -0
- package/clawpify/references/refunds.md +401 -0
- package/clawpify/references/segments.md +319 -0
- package/clawpify/references/shipping.md +406 -0
- package/clawpify/references/shop.md +307 -0
- package/clawpify/references/subscriptions.md +429 -0
- package/clawpify/references/translations.md +270 -0
- package/clawpify/references/webhooks.md +400 -0
- package/dist/agent.d.ts +18 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +100 -0
- package/dist/auth.d.ts +34 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +58 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/mcp-server.d.ts +3 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +236 -0
- package/dist/shopify.d.ts +29 -0
- package/dist/shopify.d.ts.map +1 -0
- package/dist/shopify.js +41 -0
- package/dist/skills.d.ts +8 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +36 -0
- package/package.json +100 -0
- package/src/agent.ts +133 -0
- package/src/auth.ts +109 -0
- package/src/index.ts +55 -0
- package/src/mcp-server.ts +190 -0
- package/src/shopify.ts +63 -0
- package/src/skills.ts +42 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# Shopify Pages
|
|
2
|
+
|
|
3
|
+
Manage online store pages (About Us, Contact, policies, etc.) via the GraphQL Admin API.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Pages are custom content pages displayed on the storefront, separate from products and collections.
|
|
8
|
+
|
|
9
|
+
## List Pages
|
|
10
|
+
|
|
11
|
+
```graphql
|
|
12
|
+
query ListPages($first: Int!, $after: String, $query: String) {
|
|
13
|
+
pages(first: $first, after: $after, query: $query, sortKey: TITLE) {
|
|
14
|
+
pageInfo {
|
|
15
|
+
hasNextPage
|
|
16
|
+
endCursor
|
|
17
|
+
}
|
|
18
|
+
nodes {
|
|
19
|
+
id
|
|
20
|
+
title
|
|
21
|
+
handle
|
|
22
|
+
isPublished
|
|
23
|
+
createdAt
|
|
24
|
+
updatedAt
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
Variables: `{ "first": 10 }`
|
|
30
|
+
|
|
31
|
+
## Get Page
|
|
32
|
+
|
|
33
|
+
```graphql
|
|
34
|
+
query GetPage($id: ID!) {
|
|
35
|
+
page(id: $id) {
|
|
36
|
+
id
|
|
37
|
+
title
|
|
38
|
+
handle
|
|
39
|
+
body
|
|
40
|
+
isPublished
|
|
41
|
+
publishedAt
|
|
42
|
+
createdAt
|
|
43
|
+
updatedAt
|
|
44
|
+
templateSuffix
|
|
45
|
+
metafields(first: 10) {
|
|
46
|
+
nodes {
|
|
47
|
+
key
|
|
48
|
+
namespace
|
|
49
|
+
value
|
|
50
|
+
type
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
Variables: `{ "id": "gid://shopify/Page/123" }`
|
|
57
|
+
|
|
58
|
+
## Get Pages Count
|
|
59
|
+
|
|
60
|
+
```graphql
|
|
61
|
+
query GetPagesCount {
|
|
62
|
+
pagesCount {
|
|
63
|
+
count
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Create Page
|
|
69
|
+
|
|
70
|
+
```graphql
|
|
71
|
+
mutation CreatePage($page: PageCreateInput!) {
|
|
72
|
+
pageCreate(page: $page) {
|
|
73
|
+
page {
|
|
74
|
+
id
|
|
75
|
+
title
|
|
76
|
+
handle
|
|
77
|
+
isPublished
|
|
78
|
+
}
|
|
79
|
+
userErrors {
|
|
80
|
+
field
|
|
81
|
+
message
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
Variables:
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"page": {
|
|
90
|
+
"title": "About Us",
|
|
91
|
+
"handle": "about-us",
|
|
92
|
+
"body": "<h1>About Our Company</h1><p>We are passionate about delivering quality products...</p>",
|
|
93
|
+
"isPublished": true
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Create Page with Metafields
|
|
99
|
+
|
|
100
|
+
```graphql
|
|
101
|
+
mutation CreatePageWithMetafields($page: PageCreateInput!) {
|
|
102
|
+
pageCreate(page: $page) {
|
|
103
|
+
page {
|
|
104
|
+
id
|
|
105
|
+
title
|
|
106
|
+
metafields(first: 5) {
|
|
107
|
+
nodes {
|
|
108
|
+
key
|
|
109
|
+
value
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
userErrors {
|
|
114
|
+
field
|
|
115
|
+
message
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
Variables:
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"page": {
|
|
124
|
+
"title": "Store Locations",
|
|
125
|
+
"body": "<p>Find a store near you.</p>",
|
|
126
|
+
"isPublished": true,
|
|
127
|
+
"metafields": [
|
|
128
|
+
{
|
|
129
|
+
"namespace": "custom",
|
|
130
|
+
"key": "show_map",
|
|
131
|
+
"value": "true",
|
|
132
|
+
"type": "boolean"
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Update Page
|
|
140
|
+
|
|
141
|
+
```graphql
|
|
142
|
+
mutation UpdatePage($id: ID!, $page: PageUpdateInput!) {
|
|
143
|
+
pageUpdate(id: $id, page: $page) {
|
|
144
|
+
page {
|
|
145
|
+
id
|
|
146
|
+
title
|
|
147
|
+
body
|
|
148
|
+
isPublished
|
|
149
|
+
}
|
|
150
|
+
userErrors {
|
|
151
|
+
field
|
|
152
|
+
message
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
Variables:
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"id": "gid://shopify/Page/123",
|
|
161
|
+
"page": {
|
|
162
|
+
"body": "<h1>About Our Company</h1><p>Updated content with new information...</p>"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Publish/Unpublish Page
|
|
168
|
+
|
|
169
|
+
```graphql
|
|
170
|
+
mutation PublishPage($id: ID!, $page: PageUpdateInput!) {
|
|
171
|
+
pageUpdate(id: $id, page: $page) {
|
|
172
|
+
page {
|
|
173
|
+
id
|
|
174
|
+
isPublished
|
|
175
|
+
}
|
|
176
|
+
userErrors {
|
|
177
|
+
field
|
|
178
|
+
message
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
Variables:
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"id": "gid://shopify/Page/123",
|
|
187
|
+
"page": {
|
|
188
|
+
"isPublished": true
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Delete Page
|
|
194
|
+
|
|
195
|
+
```graphql
|
|
196
|
+
mutation DeletePage($id: ID!) {
|
|
197
|
+
pageDelete(id: $id) {
|
|
198
|
+
deletedPageId
|
|
199
|
+
userErrors {
|
|
200
|
+
field
|
|
201
|
+
message
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Search Pages
|
|
208
|
+
|
|
209
|
+
```graphql
|
|
210
|
+
query SearchPages($query: String!) {
|
|
211
|
+
pages(first: 10, query: $query) {
|
|
212
|
+
nodes {
|
|
213
|
+
id
|
|
214
|
+
title
|
|
215
|
+
handle
|
|
216
|
+
isPublished
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
Variables: `{ "query": "title:contact OR title:about" }`
|
|
222
|
+
|
|
223
|
+
## Page Fields
|
|
224
|
+
|
|
225
|
+
| Field | Type | Description |
|
|
226
|
+
|-------|------|-------------|
|
|
227
|
+
| `title` | String | Page title |
|
|
228
|
+
| `handle` | String | URL handle (e.g., `/pages/about-us`) |
|
|
229
|
+
| `body` | HTML | Page content (HTML) |
|
|
230
|
+
| `isPublished` | Boolean | Visibility status |
|
|
231
|
+
| `publishedAt` | DateTime | Publication timestamp |
|
|
232
|
+
| `templateSuffix` | String | Custom template suffix |
|
|
233
|
+
|
|
234
|
+
## Template Suffixes
|
|
235
|
+
|
|
236
|
+
Use template suffixes to apply custom page templates:
|
|
237
|
+
|
|
238
|
+
```json
|
|
239
|
+
{
|
|
240
|
+
"page": {
|
|
241
|
+
"title": "Contact Us",
|
|
242
|
+
"body": "<p>Get in touch...</p>",
|
|
243
|
+
"templateSuffix": "contact"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
This uses `page.contact.liquid` template in the theme.
|
|
249
|
+
|
|
250
|
+
## Search Query Filters
|
|
251
|
+
|
|
252
|
+
| Filter | Example | Description |
|
|
253
|
+
|--------|---------|-------------|
|
|
254
|
+
| `title` | `title:about` | Filter by title |
|
|
255
|
+
| `created_at` | `created_at:>2024-01-01` | Filter by creation date |
|
|
256
|
+
| `updated_at` | `updated_at:>2024-01-01` | Filter by update date |
|
|
257
|
+
| `published_status` | `published_status:published` | Filter by publish status |
|
|
258
|
+
|
|
259
|
+
## API Scopes Required
|
|
260
|
+
|
|
261
|
+
- `read_content` - Read pages
|
|
262
|
+
- `write_content` - Create, update, delete pages
|
|
263
|
+
|
|
264
|
+
## Common Use Cases
|
|
265
|
+
|
|
266
|
+
### Policy Pages
|
|
267
|
+
```json
|
|
268
|
+
{
|
|
269
|
+
"page": {
|
|
270
|
+
"title": "Privacy Policy",
|
|
271
|
+
"handle": "privacy-policy",
|
|
272
|
+
"body": "<h1>Privacy Policy</h1><p>Your privacy is important to us...</p>",
|
|
273
|
+
"isPublished": true
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### FAQ Page
|
|
279
|
+
```json
|
|
280
|
+
{
|
|
281
|
+
"page": {
|
|
282
|
+
"title": "Frequently Asked Questions",
|
|
283
|
+
"handle": "faq",
|
|
284
|
+
"body": "<h1>FAQ</h1><details><summary>How do I track my order?</summary><p>You can track your order...</p></details>",
|
|
285
|
+
"isPublished": true
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Contact Page with Custom Template
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"page": {
|
|
294
|
+
"title": "Contact Us",
|
|
295
|
+
"handle": "contact",
|
|
296
|
+
"body": "",
|
|
297
|
+
"isPublished": true,
|
|
298
|
+
"templateSuffix": "contact"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
## Notes
|
|
304
|
+
|
|
305
|
+
- Handles must be unique and URL-safe
|
|
306
|
+
- HTML in body is sanitized by Shopify
|
|
307
|
+
- Pages are separate from product and collection pages
|
|
308
|
+
- Use metafields to store additional structured data
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
# Shopify Products & Variants
|
|
2
|
+
|
|
3
|
+
## Products
|
|
4
|
+
|
|
5
|
+
### List Products
|
|
6
|
+
|
|
7
|
+
```graphql
|
|
8
|
+
query ListProducts($first: Int!, $after: String) {
|
|
9
|
+
products(first: $first, after: $after) {
|
|
10
|
+
pageInfo {
|
|
11
|
+
hasNextPage
|
|
12
|
+
endCursor
|
|
13
|
+
}
|
|
14
|
+
nodes {
|
|
15
|
+
id
|
|
16
|
+
title
|
|
17
|
+
status
|
|
18
|
+
vendor
|
|
19
|
+
productType
|
|
20
|
+
createdAt
|
|
21
|
+
updatedAt
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
Variables: `{ "first": 10 }`
|
|
27
|
+
|
|
28
|
+
### Get Product by ID
|
|
29
|
+
|
|
30
|
+
```graphql
|
|
31
|
+
query GetProduct($id: ID!) {
|
|
32
|
+
product(id: $id) {
|
|
33
|
+
id
|
|
34
|
+
title
|
|
35
|
+
descriptionHtml
|
|
36
|
+
status
|
|
37
|
+
vendor
|
|
38
|
+
productType
|
|
39
|
+
tags
|
|
40
|
+
options {
|
|
41
|
+
name
|
|
42
|
+
values
|
|
43
|
+
}
|
|
44
|
+
variants(first: 100) {
|
|
45
|
+
nodes {
|
|
46
|
+
id
|
|
47
|
+
title
|
|
48
|
+
sku
|
|
49
|
+
price
|
|
50
|
+
inventoryQuantity
|
|
51
|
+
selectedOptions {
|
|
52
|
+
name
|
|
53
|
+
value
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
images(first: 10) {
|
|
58
|
+
nodes {
|
|
59
|
+
id
|
|
60
|
+
url
|
|
61
|
+
altText
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
Variables: `{ "id": "gid://shopify/Product/123" }`
|
|
68
|
+
|
|
69
|
+
### Search Products
|
|
70
|
+
|
|
71
|
+
```graphql
|
|
72
|
+
query SearchProducts($query: String!, $first: Int!) {
|
|
73
|
+
products(first: $first, query: $query) {
|
|
74
|
+
nodes {
|
|
75
|
+
id
|
|
76
|
+
title
|
|
77
|
+
status
|
|
78
|
+
vendor
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
Variables: `{ "query": "title:*shirt*", "first": 10 }`
|
|
84
|
+
|
|
85
|
+
Search query syntax:
|
|
86
|
+
- `title:*keyword*` - title contains keyword
|
|
87
|
+
- `status:ACTIVE` - by status (ACTIVE, DRAFT, ARCHIVED)
|
|
88
|
+
- `vendor:Nike` - by vendor
|
|
89
|
+
- `product_type:Shoes` - by product type
|
|
90
|
+
- Combine with `AND`, `OR`: `status:ACTIVE AND vendor:Nike`
|
|
91
|
+
|
|
92
|
+
### Create Product
|
|
93
|
+
|
|
94
|
+
```graphql
|
|
95
|
+
mutation CreateProduct($product: ProductCreateInput!, $media: [CreateMediaInput!]) {
|
|
96
|
+
productCreate(product: $product, media: $media) {
|
|
97
|
+
product {
|
|
98
|
+
id
|
|
99
|
+
title
|
|
100
|
+
}
|
|
101
|
+
userErrors {
|
|
102
|
+
field
|
|
103
|
+
message
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
Variables:
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"product": {
|
|
112
|
+
"title": "New Product",
|
|
113
|
+
"descriptionHtml": "<p>Product description</p>",
|
|
114
|
+
"vendor": "My Store",
|
|
115
|
+
"productType": "Clothing",
|
|
116
|
+
"status": "DRAFT",
|
|
117
|
+
"tags": ["new", "featured"]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Update Product
|
|
123
|
+
|
|
124
|
+
> REQUIRES PERMISSION: If changing product status from DRAFT to ACTIVE, this publishes the product and makes it visible to customers. Always ask the user for explicit confirmation before changing status to ACTIVE.
|
|
125
|
+
|
|
126
|
+
```graphql
|
|
127
|
+
mutation UpdateProduct($product: ProductUpdateInput!) {
|
|
128
|
+
productUpdate(product: $product) {
|
|
129
|
+
product {
|
|
130
|
+
id
|
|
131
|
+
title
|
|
132
|
+
status
|
|
133
|
+
}
|
|
134
|
+
userErrors {
|
|
135
|
+
field
|
|
136
|
+
message
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
Variables:
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"product": {
|
|
145
|
+
"id": "gid://shopify/Product/123",
|
|
146
|
+
"title": "Updated Title",
|
|
147
|
+
"status": "ACTIVE"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Delete Product
|
|
153
|
+
|
|
154
|
+
> REQUIRES PERMISSION: Deleting a product is PERMANENT and removes it from your store completely. All variants, images, and data will be lost and cannot be recovered. Always ask the user for explicit confirmation, show the product title and ID, and wait for approval before executing this operation.
|
|
155
|
+
|
|
156
|
+
```graphql
|
|
157
|
+
mutation DeleteProduct($input: ProductDeleteInput!) {
|
|
158
|
+
productDelete(input: $input) {
|
|
159
|
+
deletedProductId
|
|
160
|
+
userErrors {
|
|
161
|
+
field
|
|
162
|
+
message
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
Variables: `{ "input": { "id": "gid://shopify/Product/123" } }`
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Product Variants
|
|
172
|
+
|
|
173
|
+
### Create Variants (Bulk)
|
|
174
|
+
|
|
175
|
+
```graphql
|
|
176
|
+
mutation CreateVariants($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
|
|
177
|
+
productVariantsBulkCreate(productId: $productId, variants: $variants) {
|
|
178
|
+
productVariants {
|
|
179
|
+
id
|
|
180
|
+
title
|
|
181
|
+
sku
|
|
182
|
+
price
|
|
183
|
+
}
|
|
184
|
+
userErrors {
|
|
185
|
+
field
|
|
186
|
+
message
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
Variables:
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"productId": "gid://shopify/Product/123",
|
|
195
|
+
"variants": [
|
|
196
|
+
{
|
|
197
|
+
"barcode": "1234567890",
|
|
198
|
+
"price": "29.99",
|
|
199
|
+
"optionValues": [
|
|
200
|
+
{ "optionName": "Size", "name": "Small" },
|
|
201
|
+
{ "optionName": "Color", "name": "Blue" }
|
|
202
|
+
],
|
|
203
|
+
"inventoryItem": {
|
|
204
|
+
"sku": "SKU-001"
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Update Variants (Bulk)
|
|
212
|
+
|
|
213
|
+
```graphql
|
|
214
|
+
mutation UpdateVariants($productId: ID!, $variants: [ProductVariantsBulkInput!]!) {
|
|
215
|
+
productVariantsBulkUpdate(productId: $productId, variants: $variants) {
|
|
216
|
+
productVariants {
|
|
217
|
+
id
|
|
218
|
+
price
|
|
219
|
+
}
|
|
220
|
+
userErrors {
|
|
221
|
+
field
|
|
222
|
+
message
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
Variables:
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"productId": "gid://shopify/Product/123",
|
|
231
|
+
"variants": [
|
|
232
|
+
{
|
|
233
|
+
"id": "gid://shopify/ProductVariant/456",
|
|
234
|
+
"price": "34.99"
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Delete Variants (Bulk)
|
|
241
|
+
|
|
242
|
+
> REQUIRES PERMISSION: Bulk deleting product variants is PERMANENT and cannot be undone. All variant data will be lost. Always ask the user for explicit confirmation, list the variants to be deleted, and wait for approval before executing this operation.
|
|
243
|
+
|
|
244
|
+
```graphql
|
|
245
|
+
mutation DeleteVariants($productId: ID!, $variantsIds: [ID!]!) {
|
|
246
|
+
productVariantsBulkDelete(productId: $productId, variantsIds: $variantsIds) {
|
|
247
|
+
product {
|
|
248
|
+
id
|
|
249
|
+
}
|
|
250
|
+
userErrors {
|
|
251
|
+
field
|
|
252
|
+
message
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
Variables:
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"productId": "gid://shopify/Product/123",
|
|
261
|
+
"variantsIds": ["gid://shopify/ProductVariant/456"]
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Dangerous Operations in This Skill
|
|
266
|
+
|
|
267
|
+
The following operations require explicit user permission before execution:
|
|
268
|
+
|
|
269
|
+
| Operation | Impact | Reversible |
|
|
270
|
+
|-----------|--------|------------|
|
|
271
|
+
| `productUpdate` (status: ACTIVE) | Publishes product and makes it visible to customers | Yes (can set back to DRAFT) |
|
|
272
|
+
| `productDelete` | Permanently deletes product and all variants | No - IRREVERSIBLE |
|
|
273
|
+
| `productVariantsBulkDelete` | Permanently deletes multiple variants at once | No - IRREVERSIBLE |
|
|
274
|
+
|
|
275
|
+
Permission Protocol:
|
|
276
|
+
- For status changes to ACTIVE: Show product title and confirm publication
|
|
277
|
+
- For deletions: Show product/variant details, emphasize permanence, wait for explicit "yes", "confirm", or "proceed"
|