I am creating orders in via the admin graphql API. I am initially updating the order via the draftOrderUpdate mutation and then completing the order completion via the draftOrderComplete mutation. I am waiting for the draftOrderUpdate mutation response within a promise.all and then executing the complete step. However the order complete is failing inconsistently with the following error.
userErrors:{
message: 'This order has not finished calculating, please try again later',
__typename: 'Shopify_UserError'
},
It seems like if I place a timeout of a few hundred ms after the draftOrderUpdate mutation I can for the most part stop the error from happening however this is an inconsistent solution. I was wondering why
- The draftOrderUpdate mutation returns a success and the draft order object if it is in fact not finished processing.
- Why there needs to be a delay placed in between these 2 API calls
This seems like a potential bug in the graphql API and if this is in fact expected behaviour what is the best way to mitigate it so I don’t experience this error.
Cheers,
Neil