Description
Describe the bug
When a product variant is added to the cart, all other products in the cart are removed. When a variant is already in the cart, adding any other product removes the variant.
To Reproduce
- Add a simple product to the cart.
- Add a product variant to the cart. The simple product will disappear.
- Add any number of simple products to the cart. The variable product will disappear, but all simple products will exist.
Note: This error does not occur if using GraphiQL from the WordPress dashboard. Instead, send the queries from a client application, Postman, or some other external source.
Expected behavior
All products should be added to the cart without affecting other products.
Desktop:
- OS: Windows
- Browser: Firefox
- Version: 83.0
Additional context
This issue doesn't happen when using the built-in GraphiQL interface. However, this may be because, since it's embedded in WordPress, vanilla WooCommerce is able to manage the cart directly and it overwrites whatever error is occurring when using GraphQL externally.