Skip to content

cartMergeUndo

Mutationin Authentication

Undo the merge signing in made: the current cart becomes the guest cart as it was before signing in, and the saved cart gets its own items back. Only once per sign-in, and only while CartMerge.undoable said so.

Returns

CartMergeUndoResponse!

FieldTypeDescription
successBoolean!Whether the guest cart was restored. It is then the current cart, so refetch the cart query.
cartErrors[CartMergeUndoError!]Error details if the merge could not be undone

Example

mutation CartMergeUndo {
cartMergeUndo {
success
cartErrors {
__typename
... on ValidationError {
message
}
... on CartError {
message
code
}
}
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved
@evolve-framework/medusaResolved
@evolve-framework/sfccResolved

Used by

The storefront packages that send it, in these GraphQL documents: