shopify-known-pitfalls
Identify and avoid Shopify API anti-patterns: ignoring userErrors, wrong API version, REST instead of GraphQL, missing GDPR webhooks, and webhook timeout issues. Use when reviewing a Shopify codebase, preparing for App Store submission, or debugging mysterious API failures. Trigger with phrases like "shopify mistakes", "shopify anti-patterns", "shopify pitfalls", "shopify what not to do", "shopify code review".
What this skill does
# Shopify Known Pitfalls ## Overview The 10 most common mistakes when building Shopify apps, with real API examples showing the wrong way and the right way. ## Prerequisites - Existing Shopify app codebase to review or audit - Familiarity with GraphQL Admin API query patterns and response shapes - Access scopes configured for the APIs your app uses - `@shopify/shopify-api` v9+ installed (for code examples) ## Instructions Each pitfall includes a wrong-way and right-way code example. See [Pitfall Examples](references/pitfall-examples.md) for all 10 complete code comparisons. ### Pitfall #1: Not Checking userErrors (The #1 Mistake) Shopify GraphQL mutations return HTTP 200 even when they fail. The errors are in `userErrors`. Always check `userErrors.length > 0` before accessing the result. ### Pitfall #2: Using REST When GraphQL Is Required REST Admin API is legacy as of October 2024. New public apps after April 2025 **must** use GraphQL. GraphQL also lets you request only the fields you need. ### Pitfall #3: Ignoring API Version Deprecation Shopify deprecates API versions ~12 months after release. Use `LATEST_API_VERSION` from `@shopify/shopify-api` and monitor `x-shopify-api-deprecated-reason` response headers. ### Pitfall #4: Missing Mandatory GDPR Webhooks Your app **will be rejected** from the App Store without `customers/data_request`, `customers/redact`, and `shop/redact` webhook handlers. ### Pitfall #5: Webhook Handler Takes Too Long Shopify expects a 200 response within 5 seconds. Respond immediately and queue work asynchronously, otherwise Shopify retries and creates duplicates. ### Pitfall #6: Using ProductInput on API 2024-10+ The `ProductInput` type was split into `ProductCreateInput` and `ProductUpdateInput` in 2024-10. Use the specific type for each operation. ### Pitfall #7: Not Using Cursor Pagination Shopify uses Relay-style cursor pagination, not page numbers. Use `after` / `endCursor` with `pageInfo`. ### Pitfall #8: Requesting 250 Items Per Page `first: 250` with nested connections creates enormous query costs that THROTTLE immediately. Use `first: 50` or smaller with nested resources. ### Pitfall #9: Exposing Admin Token in Client-Side Code Admin API tokens have full access. Never send them to the browser — proxy through your server. ### Pitfall #10: Not Handling APP_UNINSTALLED Webhook When a merchant uninstalls your app, clean up sessions immediately. Stale sessions cause auth redirect loops on reinstall. ## Output - Anti-patterns identified in codebase - Fixes prioritized (security first, then correctness) - Prevention measures in place (linting, CI checks) ## Error Handling | Pitfall | How to Detect | Prevention | |---------|--------------|------------| | Missing userErrors check | Null pointer crashes | ESLint rule or wrapper function | | REST usage | `grep -r "clients.Rest" src/` | Migration guide + lint rule | | Old API version | `grep -r "apiVersion" src/` | CI check against supported versions | | Missing GDPR webhooks | App Store rejection | Pre-submit compliance checker | | Webhook timeout | Shopify retry storms | Queue-based processing | | ProductInput on 2024-10 | GraphQL type error | Update mutations | | Page-based pagination | Query errors | Use cursor pagination pattern | | `first: 250` | THROTTLED responses | Query cost budgets | | Admin token in client | Security audit | Server-side proxy | | No APP_UNINSTALLED | Auth loops on reinstall | Webhook handler + session cleanup | ## Examples ### Quick Pitfall Scan Run automated detection against your Shopify codebase to find REST usage, missing userErrors checks, old API versions, hardcoded tokens, and oversized page requests. See [Pitfall Scan Script](references/pitfall-scan-script.md) for the complete scan script. ## Resources - Shopify App Requirements - [GraphQL Migration Guide](https://shopify.dev/docs/apps/build/graphql/migrate/learn-how) - [2024-10 Breaking Changes](https://shopify.dev/docs/api/release-notes/2024-10) - [Webhook Best Practices](https://shopify.dev/docs/apps/build/webhooks) ## Quick Reference Card | Pitfall | Detection | Fix | |---------|-----------|-----| | No userErrors check | Null crashes on mutations | Always check `userErrors.length > 0` | | REST instead of GraphQL | `grep "clients.Rest"` | Migrate to `clients.Graphql` | | Old API version | `grep "2023-"` | Use `LATEST_API_VERSION` from SDK | | Missing GDPR webhooks | App Store rejection | Add 3 mandatory webhook handlers | | Webhook timeout | Retry storms, duplicates | Respond 200 immediately, queue processing | | ProductInput on 2024-10 | Type error | Use `ProductCreateInput` / `ProductUpdateInput` | | Page-number pagination | Query errors | Use cursor-based with `pageInfo` | | `first: 250` with nesting | THROTTLED | Use `first: 50` or smaller | | Admin token in browser | Security scan | Server-side proxy only | | No APP_UNINSTALLED | Auth loop on reinstall | Clean up sessions on uninstall |
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.