NewCartLine
●cart · /core·type
Minimal input needed to add a variant to a cart. Passed to createCart
or the add-line mutation; the adapter expands it into a full
using catalog data from the provider.
Properties
PROPTYPEDESCRIPTION
quantity
number
variantId
string
attributes?
{ key: string; value: string }[]
Example
const line: NewCartLine = { variantId: 'gid://shopify/ProductVariant/1', quantity: 2 };
await kernel.mutate(ctx, { kind: 'add-line', ...line });Related
RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartError CartNotFoundError CartProviderError CartUserError CartAdapter
MetadataOpen in GitHub ↗
MutationFn
Core mutation primitive: an async function that accepts a and its dispatch context, and returns the resulting cart snapshot.
ProductSnapshot
Denormalized product data captured at addtocart time and carried on the addline mutation. Allows UI layers to render optimistic line items before the adapter ro