Skip to content
Discussion options

You must be logged in to vote

Your reading is right for beta.7, and main still has the same line. In createCartsCollection.ts only addItemEndpoint gets cartItemMatcher. mergeCartEndpoint({ cartsSlug }) gets none, so the merge operation falls back to defaultMergeItemMatcher, which compares product and variant IDs only.

The comment above that line hints at why it was left out: the types don't line up. CartItemMatcher takes newItem: NewCartItem, where product/variant are plain IDs, while the merge matcher takes newItem: CartItemData, where they can be populated docs. Passing the plugin matcher straight through doesn't type-check, so the fix needs a cast or a wider matcher type.

At runtime it's safe. mergeCart loads both …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alekseykurylev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants