SubmitMutation
Server-action signature that transport layers (Next.js, Remix, tRPC) implement to accept a from the client and return a . Wires the kernel into the framework's action pipeline while keeping the kernel itself framework-agnostic.
Definition
type SubmitMutation = (envelope: MutationEnvelope) => Promise<CartActionResult<TExt>>;(envelope: MutationEnvelope) => Promise<CartActionResult<TExt>>
Example
const submitMutation: SubmitMutation = async (envelope) => {
const cart = await kernel.mutate({ ...ctx, idempotencyKey: envelope.idempotencyKey }, envelope.mutation);
return { ok: true, cart };
};Related
RunCartAdapterContractOpts runCartAdapterContract CartCapabilityUnsupportedError CartError CartNotFoundError CartProviderError CartUserError CartAdapter
runCartAdapterContract
Vitestbound contract suite that every implementation must pass. Hosts call this once per adapter at import time inside a .test.ts file; the suite registers desc
tracing
Builtin middleware that wraps each mutation in an OTelshaped span. Span name is cart.mutation.<kind; attributes include the mutation kind and (when present) ide