shopify-graphql-reference
Skill127 starsChanged 21 days agoMITView on GitHub
Integrate Shopify-validated Storefront or Customer Account GraphQL into Vercel Shop. Use after Shopify AI Toolkit has supplied and validated an API operation, or when adapting existing GraphQL to the template's operation placement, fragments, domain transforms, locale flow, cache role, invalidation, and route architecture.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- build-shopSkill
- enable-analyticsSkill
- enable-i18nSkill
- enable-shopify-marketsSkill
- enable-shopify-menusSkill
- init-vercel-shopSkill
- update-shopSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Treat Shopify AI Toolkit as authoritative for Shopify documentation, schemas, fields, arguments, enum values, API versions, operation …
- Very specific: line 10
Read references/REFERENCE.md before editing.
- Distinctive: line 15
Use Shopify AI Toolkit's Storefront GraphQL skill for catalog, search, menus, cart, and public metaobject reads.
- Distinctive: line 16
Use its Customer skill for profiles, orders, addresses, and other authenticated customer data.
- Distinctive: line 17
Use its custom-data skill first for metafields or metaobjects.
- Distinctive: line 18
Search current Shopify documentation and validate the complete operation with that skill.
- Distinctive: line 19
Do not copy schema snapshots, field catalogs, or generated API reference into this skill.
- Distinctive: line 20
If Shopify AI Toolkit is unavailable, use official Shopify documentation and validation tooling.
- Very specific: line 31
Never place carts in the Next.js data cache.
- Distinctive: line 36
Run local lint, typecheck, focused tests, and affected commerce flows.
- Very specific: line 42
Do not present this skill as a Shopify schema source.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Integrate Shopify GraphQL
Treat Shopify AI Toolkit as authoritative for Shopify documentation, schemas, fields, arguments, enum values, API versions, operation design, and validation. This skill owns only the Vercel Shop integration layer.
Read references/REFERENCE.md before editing.
Delegate Shopify facts first
- Choose the Shopify API:
- Use Shopify AI Toolkit's Storefront GraphQL skill for catalog, search, menus, cart, and public metaobject reads.
- Use its Customer skill for profiles, orders, addresses, and other authenticated customer data.
- Use its custom-data skill first for metafields or metaobjects.
- Search current Shopify documentation and validate the complete operation with that skill.
- Do not copy schema snapshots, field catalogs, or generated API reference into this skill.
- If Shopify AI Toolkit is unavailable, use official Shopify documentation and validation tooling; do not guess.
Apply the Vercel Shop conventions
- Inspect the consuming route before choosing cache behavior. Classify the read as static-shell content, request-time shared content, or private/request-scoped data.
- Add the operation to
lib/shopify/operations/<resource>/server.tsin the closest resource domain as an uncachedfetch*function with nonext/cacheimport. Put the cache directive,cacheLife, andcacheTagcalls in aget*wrapper in the consuming domain'slib/<domain>/server.ts(for examplelib/product/server.ts,lib/collections/server.ts,lib/policies/server.ts). Keep pure transforms inlib/shopify/transforms/<resource>/index.ts, named shared contracts in the owning domain'stypes.ts, and reusable fragment documents in their resource domain. Import implementations and types directly; do not add barrels or forwarding exports. - Wrap documents in Hydrogen's
gql()with a leading#graphqlcomment, keep them static, and use variables for dynamic values. Inference supplies types; Shopify AI Toolkit validates fields and arguments. - Reuse the smallest existing fragment that fits by passing it in the
gql(source, [FRAGMENT])list. Extend a shared fragment only when multiple operations need the same selection. - Pass
localetostorefront.requestwhen Shopify localizes the result; never addcountryorlanguagetovariables. - Derive raw Shopify types from fragment documents with
ResultOf<typeof FRAGMENT>underlib/shopify/**; transform catalog/account data into domain types before presentation. Cart types intentionally derive from Hydrogen handlers throughlib/cart/types.ts. - Preserve cache tags and the existing webhook invalidation hierarchy. Do not cache mutations.
- Never place carts in the Next.js data cache; cart reads are memoized per request via
getCart, so cart mutations need no cache invalidation step.
Revalidate both boundaries
- Validate the final GraphQL document again with Shopify AI Toolkit after fragment and variable changes.
- Run local lint, typecheck, focused tests, and affected commerce flows; run a build when the changed surface requires it. Exercise the operation against the store once; typecheck does not catch invalid fields.
- Report separately:
- Shopify validation performed;
- Vercel Shop cache and route role;
- domain transform and invalidation changes.
Do not present this skill as a Shopify schema source. Shopify AI Toolkit determines what Shopify supports; this skill determines how validated operations fit Vercel Shop.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

