xcladeDocs
Storefront GraphQL

Migration Guide

Migrate stores from Shopify/BigCommerce or upgrade from legacy REST / @xclade/graphql-client v1 to @xclade/sdk v2

Migration Guide

1. Upgrading from Legacy @xclade/graphql-client v1 to @xclade/sdk v2

If you built an earlier storefront against @xclade/graphql-client + @xclade/types, migrate to the unified zero-dependency @xclade/sdk v2.0:

pnpm remove @xclade/graphql-client @xclade/types graphql-request
pnpm add @xclade/sdk
// Before (v1)
import { createGraphQLClient } from '@xclade/graphql-client';

// After (v2)
import { createXcladeSDK } from '@xclade/sdk';

export const xclade = createXcladeSDK({
  baseUrl: 'https://{shortId}.api.myxclade.com',
  publishableKey: 'pk_live_...',
});

const { products } = await xclade.store.listProducts({
  limit: 20,
  currency_code: 'usd',
});

Key Header & URL Updates

  • Store GraphQL Endpoint: POST https://{shortId}.api.myxclade.com/graphql (Storefront) and POST https://{shortId}.api.myxclade.com/admin/graphql (Admin).
  • Control Plane Base URL: Root-mounted directly at https://api.xclade.com (e.g. https://api.xclade.com/orgs/*, https://api.xclade.com/health).
  • Preferred Headers: X-Xclade-Publishable-Key (backwards-compatible with X-Publishable-Api-Key), X-Xclade-Locale (compatible with X-Locale), and X-Xclade-Request: true (compatible with X-GraphQL-Request: true).

2. Migrating from Shopify or BigCommerce

xclade includes a built-in streaming migrator inside https://app.xclade.com:

  1. Open your store in the xclade Console → Migrations.
  2. Connect your Shopify or BigCommerce store credentials.
  3. Run the streaming import for categories, collections, products (including multi-option variants & media mirrored directly to S3/CDN), customers, and historical orders.
  4. For custom scripts or ERP migrations, use the high-throughput Admin GraphQL Batch Mutations (importCategoriesBatch, importCollectionsBatch, importProductsBatch, importCustomersBatch, importOrdersBatch — up to 16 MiB per request on /admin/graphql).

3. Moving from Legacy REST Endpoints to Go GraphQL

Legacy REST PatternNative Go GraphQL Equivalent
GET /store/productsquery { products(limit: 20, pricing_context: { currency_code: "usd" }) { ... } } on /graphql
POST /store/cartsmutation { createCart(input: { region_id: "..." }) { ... } } on /graphql
POST /store/carts/:id/completemutation { completeCart(cart_id: "...") { ... } } on /graphql
GET /admin/productsquery { adminProducts(limit: 50) { ... } } on /admin/graphql
POST /admin/orders/:id/fulfillmentsmutation { createOrderFulfillment(input: { ... }) { ... } } on /admin/graphql

On this page