My flow is currently as follows:
This results in every order creating 1 legitimate customer from step 2 and N illegitimate customers from step 1 based on how many time draftOrderCalculate was called.
DraftOrderCalculate seems to have the side effect of creating phantom customers. The customers dont exist until after the order has been completed.
1. calculate a draft order with shipping address and NO email or customer id
2. calculate it multiple times
3. create draft order with same address used in the calculation
4. complete draft order
5. observe multiple customers created
Attempts to mitigate:
use same email in draft order as customer, check for existing user with that email, and create if not exists - this doesnt work. The check for an existing customer returns "not found" but the creation of the customer fails with "email taken"
use a standard email for calculations - this works, but obviously creates 1 customer attached to the email used for calculations.
Is this mutation supposed to create customers as a side effect? Can I calculate an order without creating phantom users?
Hi @almax120 ,
In my testing I'm seeing customers created after every draftOrderCalculate call when no customer specific information like email is provided. Doing some internal investigation this is intended behaviour. I wanted to point out that if you provide an email in the draftOrderCalculate for a customer that already exists a new customer will not be created and the draft order will be associated with that existing customer.
Your point about querying for a customer by email and no result being returned, I just wanted to confirm if the APP making the request has read_customer scope.