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) andPOST 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 withX-Publishable-Api-Key),X-Xclade-Locale(compatible withX-Locale), andX-Xclade-Request: true(compatible withX-GraphQL-Request: true).
2. Migrating from Shopify or BigCommerce
xclade includes a built-in streaming migrator inside https://app.xclade.com:
- Open your store in the xclade Console → Migrations.
- Connect your Shopify or BigCommerce store credentials.
- Run the streaming import for categories, collections, products (including multi-option variants & media mirrored directly to S3/CDN), customers, and historical orders.
- 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 Pattern | Native Go GraphQL Equivalent |
|---|---|
GET /store/products | query { products(limit: 20, pricing_context: { currency_code: "usd" }) { ... } } on /graphql |
POST /store/carts | mutation { createCart(input: { region_id: "..." }) { ... } } on /graphql |
POST /store/carts/:id/complete | mutation { completeCart(cart_id: "...") { ... } } on /graphql |
GET /admin/products | query { adminProducts(limit: 50) { ... } } on /admin/graphql |
POST /admin/orders/:id/fulfillments | mutation { createOrderFulfillment(input: { ... }) { ... } } on /admin/graphql |