Overview
Native Go 1.26 (gqlgen) Storefront & B2B GraphQL API — 53 Queries, 45 Mutations, 22 Commerce Domains
Storefront & B2B GraphQL (/graphql)
Every xclade store serves a strongly-typed, code-generated Go 1.26 (gqlgen) GraphQL endpoint at:
POST https://{shortId}.api.myxclade.com/graphqlUnlike legacy Node.js wrappers, the GraphQL execution layer compiles directly into your store's Go binary—delivering low memory overhead, concurrent field execution, per-request Go DataLoader batching, and predictable sub-50ms p95 latency.
Core Capabilities
| Capability | Implementation |
|---|---|
| Schema Coverage | 22 domain schema files, 53 Queries, and 45 Mutations spanning DTC catalog, contextual pricing, carts, checkout, ID Rabbit verification, passwordless OTP, orders, returns, reviews, and full B2B wholesale. |
| Runtime Engine | Native Go 1.26 + github.com/99designs/gqlgen + chi/v5 + pgx/v5 + go-redis/v9. |
| N+1 Prevention | Per-request Go DataLoader batching (graph/loaders/) for collections, categories, product types, currencies, regions, countries, and order items. |
| Response Caching | Built-in XcladeResponseCache caches 17 allowlisted public queries in Redis, isolated by tenant scope, publishable key sales channels, locale, and actor—with automatic gql:public tag invalidation on mutations. |
| Persisted Queries | Automatic Persisted Queries (APQ) backed by an LRU hash cache (512 entries) plus a 1,000-entry parsed AST cache. |
| Security Hardening | Built-in XcladeGraphQLArmor enforcing AST depth, alias, directive, batch, payload size, execution timeout, CSRF GET preflight, and Redis sliding-window rate limits. |
Dual GraphQL Surfaces
Every store pod exposes two cleanly separated GraphQL endpoints:
POST /graphql— Storefront, customer accounts, and B2B buyer workflows (documented in this section).POST /admin/graphql— Back-office operations, RBAC, WMS bins/cycle counts, analytics, and batch imports (see Merchant Admin GraphQL).
Minimal Example
curl -X POST https://{shortId}.api.myxclade.com/graphql \
-H "Content-Type: application/json" \
-H "X-Xclade-Publishable-Key: pk_live_..." \
-H "X-Xclade-Request: true" \
-d '{
"query": "query Catalog($currency: String!) { products(limit: 4, pricing_context: { currency_code: $currency }) { products { id title handle variants { id sku inventory_quantity calculated_price { calculated_amount currency_code } } } count } }",
"variables": { "currency": "usd" }
}'Next Steps
Authentication & Headers
Publishable keys, customer/admin JWTs, passwordless 6-digit email OTP, locale headers, and CSRF rules.
Complete Schema Reference
Every single one of the 53 Storefront queries and 45 mutations with signatures and access levels.
Queries & Mutations Cookbook
Schema-verified GraphQL operations ready to paste into your app or GraphiQL.
Security Limits & Quotas
Exact Go middleware caps for depth, aliases, directives, batching, payload sizes, and rate limits.