返回 Skill 列表
extension
分类: 开发与工程无需 API Key

shopify-developer

完整的Shopify开发参考,包括Liquid模板、主题开发(OS 2.0)、GraphQL Admin API、Storefront API、自定义应用程序开发、Shopify Functions、Hydrogen、性能优化和调试。在处理.liquid文件、创建主题部分和块、为Shopify编写GraphQL查询或变更、使用CLI和Polaris构建Shopify应用程序、通过Ajax API实现购物车操作、优化Shopify商店的核心Web重要指标、调试Liquid或API错误、配置settings_schema.json、访问Shopify对象(产品、集合、购物车、客户)、使用Liquid过滤器、创建应用程序扩展、处理webhook、从Scripts迁移到Functions,或使用Hydrogen和React Router 7构建无头店面时使用。涵盖API版本2026-01。

person作者: jakexiaohubgithub

Shopify Developer Reference

Comprehensive reference for professional Shopify development - API version 2026-01.

Quick Reference

| Item | Value | |------|-------| | API version | 2026-01 (stable) | | GraphQL Admin | POST https://{store}.myshopify.com/admin/api/2026-01/graphql.json | | Storefront API | POST https://{store}.myshopify.com/api/2026-01/graphql.json | | Ajax API (theme) | /cart.js, /cart/add.js, /cart/change.js | | CLI install | npm install -g @shopify/cli | | Theme dev | shopify theme dev --store {store}.myshopify.com | | App dev | shopify app dev | | Deploy | shopify app deploy | | Docs | shopify.dev |

Choose Your Path

Read the reference file(s) that match your task:

Liquid templating - writing or debugging .liquid files:

Theme development - building or customising themes:

API integration - fetching or modifying data programmatically:

App development - building Shopify apps:

Serverless logic - custom business rules:

Headless commerce - custom storefronts:

Optimisation and troubleshooting:

Deprecation Notices

| Deprecated | Replacement | Deadline | |------------|-------------|----------| | Shopify Scripts | Shopify Functions | August 2025 (migration), sundown TBD | | checkout.liquid | Checkout Extensibility | August 2024 (Plus), done | | REST Admin API | GraphQL Admin API | Active deprecation (no removal date yet) | | Legacy custom apps | New auth model | January 2025 (done) | | Polaris React | Polaris Web Components | Active migration | | Remix (app framework) | React Router 7 | Hydrogen 2025.5.0+ |

Liquid Essentials

Three syntax types:

{{ product.title | upcase }}                    {# Output with filter #}
{% if product.available %}In stock{% endif %}   {# Logic tag #}
{% assign sale = product.price | times: 0.8 %}  {# Assignment #}
{%- if condition -%}Stripped whitespace{%- endif -%}

Key patterns:

{% for product in collection.products limit: 5 %}
  {% render 'product-card', product: product %}
{% endfor %}

{% paginate collection.products by 12 %}
  {% for product in paginate.collection.products %}...{% endfor %}
  {{ paginate | default_pagination }}
{% endpaginate %}

API Essentials

// GraphQL Admin - always use GraphQL over REST
const response = await fetch(
  `https://${store}.myshopify.com/admin/api/2026-01/graphql.json`,
  {
    method: 'POST',
    headers: {
      'X-Shopify-Access-Token': accessToken,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ query, variables }),
  }
);
const { data, errors } = await response.json();
if (errors) throw new Error(errors[0].message);

// Ajax API (theme-only cart operations)
fetch('/cart/add.js', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ id: variantId, quantity: 1 }),
});

Reference Files

| File | Lines | Coverage | |------|-------|----------| | liquid-syntax.md | ~600 | Tags, control flow, iteration, variables, whitespace, LiquidDoc | | liquid-filters.md | ~870 | String, numeric, array, Shopify-specific, date, URL, colour filters | | liquid-objects.md | ~695 | All Shopify objects: product, variant, collection, cart, customer, order, etc. | | theme-development.md | ~1200 | File structure, JSON templates, sections, blocks, settings schema, layout | | api-admin.md | ~595 | GraphQL queries/mutations, REST (legacy), OAuth, webhooks, rate limiting | | api-storefront.md | ~235 | Storefront API, Ajax API, cart operations, Customer Account API | | app-development.md | ~760 | CLI, app architecture, extensions, Polaris Web Components, deployment | | functions.md | ~300 | Function types, Rust/JS targets, CLI workflow, Scripts migration | | hydrogen.md | ~375 | Setup, routing, data loading, Storefront API, deployment | | performance.md | ~605 | Images, JS, CSS, fonts, Liquid, third-party scripts, Core Web Vitals | | debugging.md | ~650 | Liquid, JavaScript, API, cart, webhook, theme editor troubleshooting |