saleor/saleor
在 GitHub 查看Bug: Mutation CheckoutCustomerAttach should not throw error when reattaching the same user
Open
#12,037 创建于 2023年2月15日
buggood first issuegraphql
描述
What are you trying to achieve?
Currently, mutation CheckoutCustomerAttach throws an error when checkout.customer is already attached and we're trying to attach the same authenticated customer. (This flow is not the same as for e.g shipping address, that can be overwritten with the same data with a success returned from the api). On top of that, the error is a graphql permission denied error, unlike what's presented in playground (screens below). It'd make stuff much easier for frontend if:
- the mutation would return success if we're trying to reattach the same customer
- in case of trying to attach a different customer returned error would be a checkout error with error code so frontend can handle it nicely
Here are some screenshots:
Steps to reproduce the problem
- Create a checkout
- Obtain user access token
- Attach customer to checkout using CheckoutCustomerAttach mutation
- Try to repeat step 3 - api throws error
What did you expect to happen?
For the mutation to return a success
Logs
No response
Environment
Saleor version: currently master staging OS and version: macOS Monterey 12.06