shopify-graphql-cost-optimizer
Skill by jeremylongshore
Explains how to manage Shopify's calculated GraphQL query cost and avoid throttling. Aimed at developers building Shopify apps who hit THROTTLED errors or need to optimize Admin API queries.
Install shopify-graphql-cost-optimizer
Built from the published package, never by AI.
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.claude/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/shopify-graphql-cost-optimizer ~/.claude/skills/shopify-graphql-cost-optimizerRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install shopify-graphql-cost-optimizer in Claude Code
git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace /tmp/tons-of-skills-marketplace && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/tons-of-skills-marketplace/skills/.curated/shopify-graphql-cost-optimizer ~/.gemini/antigravity-cli/skills/shopify-graphql-cost-optimizerAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install shopify-graphql-cost-optimizer in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill explains how to manage the calculated query cost of Shopify's GraphQL Admin API so that requests avoid throttling. It describes the token bucket model, which has a 1,000 point maximum and refills at 50 points per second for standard plans. It shows how to read cost data in extensions.cost, including requestedQueryCost and actualQueryCost, and how to predict a query's cost before running it.
The skill covers cost reduction techniques such as smaller first values, selecting fewer fields, and avoiding deep nesting. For large exports of 250 or more items, it recommends bulk operations, which bypass the cost system. It also lists common errors such as THROTTLED and MAX_COST_EXCEEDED. It is aimed at developers building Shopify apps who hit throttling or want to optimize GraphQL queries.
Written from the project's SKILL.md and checked against it.
What it can do
- Read cost headersReads cost data in extensions.cost, including requested and actual query cost and the throttle status.
- Predict query costEstimates a query's cost using connection and field rules before running it.
- Cost reduction techniquesLowers cost by reducing first values, selecting fewer fields and avoiding deep nesting.
- Bulk operationsCovers bulkOperationRunQuery, polling and JSONL download for large data sets.
- Error handlingExplains THROTTLED, MAX_COST_EXCEEDED, QUERY_TOO_COMPLEX and bulk operation errors and their fixes.
What you need
- Shopify app with GraphQL Admin API access
- @shopify/shopify-api package
- Understanding of GraphQL connections (edges/node pattern)
- Claude Code
Try asking
- Estimate the query cost of my Shopify products query with variants
- Why is my Shopify GraphQL request returning THROTTLED errors?
- Should I use a bulk operation to export 10,000 Shopify products?
Good to know
- Only one bulk operation per app per store is allowed at a time.
- A single query over 1,000 points fails with MAX_COST_EXCEEDED.
- Designed for Claude Code.
Security check
B- Allowed to use Write, Edit without limitsIn
SKILL.md
Checked automatically: skills/.curated/shopify-graphql-cost-optimizer/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: ReadWriteEditBash(npm:*)Grep
-
SKILL.md5 KB -
references/bulk-operations.md6 KB -
references/cost-calculation-rules.md4 KB -
references/query-splitting.md4 KB
Alternatives to shopify-graphql-cost-optimizer
All alternatives →Shopify skill that lets an AI assistant set up and run a Shopify store through Shopify's official MCP server. It is for people who want to sell online, start a store, or manage an existing Shopify store.
Guides an AI assistant through building Shopify apps, extensions and themes. It covers the GraphQL Admin API, Shopify CLI, Polaris UI and Liquid. Intended for Shopify developers.
Searches Ticketmaster events and seat listings with pricing for people looking for event tickets. It returns Ticketmaster checkout links but cannot complete a purchase itself.
Analyzes ecommerce SEO for product pages, product schema, Google Shopping visibility, Amazon marketplace signals and keyword gaps. Built for stores, catalogs and product listings. Live Shopping and Amazon data needs the optional DataForSEO Merchant API.
Drafts replies to customer emails and tickets using order, refund, CRM and support desk data, in the owner's writing voice. Refunds and sends need the owner's approval, and with Shopify it also flags orders needing attention.
Reviews generated or changed WooCommerce code before it ships. It is for developers building extensions, payment and shipping integrations, checkout customizations, and order or product logic.
Compare with shopify, shopify-development or ticketmaster
shopify-graphql-cost-optimizer: common questions
How does Shopify calculate GraphQL query cost?
Each object field costs 1 point. A connection costs its first or last value multiplied by the child cost, plus 2, and nested connections multiply.
When should I use bulk operations instead of paginated queries?
The skill recommends bulk operations when you need 250 or more items, since bulkOperationRunQuery bypasses the cost system and returns JSONL.
Can I run more than one bulk operation at a time?
No. The source says only one bulk operation per app per store is allowed, so poll the current operation before starting another.
How do I install shopify-graphql-cost-optimizer?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is shopify-graphql-cost-optimizer free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is shopify-graphql-cost-optimizer safe to use?
It scores 79 of 100. Grades: maintenance A, licence A, quality A. Security check: grade B (allowed to use write, edit without limits). Review the code before you install. How grades work.
What are alternatives to shopify-graphql-cost-optimizer?
Similar skills: shopify, shopify-development, ticketmaster, seo-ecommerce.
