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
PROPTYPEDESCRIPTION
image
{ altText: string |
null; height: number; url: string; width: number } | nullproductHandle
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 });Related
RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartError CartNotFoundError CartProviderError CartUserError CartAdapter
MetadataOpen in GitHub ↗
NewCartLine
Minimal input needed to add a variant to a cart. Passed to createCart or the addline mutation; the adapter expands it into a full using catalog data from the pr
retry
Builtin middleware that retries transport / provider failures with linear backoff. Errors matched by name to CartUserError, CartNotFoundError, and CartCapabilit