Description
As a developer I want to assign a customer to an existing guest cart so that I can easily implement the checkout with the register method.
At the moment there is no possibility to easily implement the checkout with the register method when using the graphql api.
The Venia Storefront Demo is also facing the issue as the checkout with the register method is not working correctly. If you place an order there and register simultaneously the order is not connected to your new user account, which contradicts the purpose of this register checkout method.
There is a REST endpoint which does exactly what's needed to solve the problem.
The mergeCarts mutation doesn't solve the problem as it just merges cart items.
The solution would be to either make the mergeCarts mutation merge ALL data into the customer cart or add a new mutation which assigns a customer to a guest cart. The implementation would be quite simple as the GuestCartManagementInterface::assignCustomer() method does exactly what's needed.