ProductSnapshot

cart · /core·type

Denormalized product data captured at add-to-cart time and carried on the add-line mutation. Allows UI layers to render optimistic line items before the adapter round-trip completes, without a separate catalog fetch.

Properties

image
{ altText: string | null; height: number; url: string; width: number } | null
productHandle
string
productTitle
string
unitPrice
variantId
string

Example

const snapshot: ProductSnapshot = {
  variantId: variant.id,
  productHandle: product.handle,
  productTitle: product.title,
  variantTitle: variant.title,
  image: variant.image,
  unitPrice: variant.price,
};
await kernel.mutate(ctx, { kind: 'add-line', variantId: variant.id, quantity: 1, snapshot });

RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartError CartNotFoundError CartProviderError CartUserError CartAdapter

Sourcetypes.ts:160Edit the JSDoc directly

On this page