A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hello,
please let me share a strange phenomenon while processing draft orders with draftOrderComplete mutation here and I need your help to solve this. Attachment is a figure explaining this problem.
I'm using API version 2022-10
[Problem]
[Flow of my current code]
The reason why I use webhook catching DRAFT_ORDERS_CREATE instead of calling draftOrderComplete just after draftOrderCreate is, to guarantee my code calls draftOrderComplete just once. (but it seems using webhook doesn't solve the trouble)
{
"draftOrderComplete": {
"draftOrder": {
"id": "gid://shopify/DraftOrder/923981775032",
"name": "#D533",
"order": {
"id": "gid://shopify/Order/4884808106168",
"name": "#1526",
"__typename": "Order"
},
"__typename": "DraftOrder"
},
"userErrors": [],
"__typename": "DraftOrderCompletePayload"
}
}
Hey @mktb, could you share a plain text X-Request-ID that would have been sent in the responses headers you received back from us for the draft order that errored?
We can use that to take a look into the exact API call in our logs and see if we can potentially track down what's causing the draft order creation process to duplicate.
Thanks - hope to hear from you soon!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hello @ShopifyDevSup ,
Thank you for your reply!
Please let me share the X-Request-IDs of two errored orders and one successful order here.
I'm logging IDs of both draftOrderCreate & draftOrderComplete mutations for your reference.
[Errored order 1]
draftOrderCreate
Creating: gid://shopify/DraftOrder/924191916216
X-Request-ID: 8b9d20b3-0ad9-495d-a58e-d21510963324
draftOrderComplete
Converting from: gid://shopify/DraftOrder/924191916216
To: gid://shopify/Order/4888265752760
X-Request-ID: 06968e17-4fb4-4719-a301-818daabe64e6
[Errored order 2]
draftOrderCreate
Creating: gid://shopify/DraftOrder/924195586232
X-Request-ID: 292b2a22-518b-41b1-bb80-5801784af3fd
draftOrderComplete
Converting from: gid://shopify/DraftOrder/924195586232
To: gid://shopify/Order/4888377721016
X-Request-ID: 6b7ab838-8c52-4f99-8726-f9d1e8bb652e
[Successful order (for reference)]
draftOrderCreate
Creating: gid://shopify/DraftOrder/924197519544
X-Request-ID: ffb2a532-ed2a-4dda-887d-95590ecefe49
draftOrderComplete
Converting from: gid://shopify/DraftOrder/924197519544
To: gid://shopify/Order/4888388993208
X-Request-ID: 411071c4-324e-442f-9bcf-b14004915bcf
Thank for sending that info over @mktb - really appreciated! I wanted to get back in touch to confirm that our developers are currently looking into this. I can't guarantee a turnaround time or an exact resolution at the moment, but did want to update you on this. I'll reach back out once I have more information - just wanted to confirm that it does appear that similar issues relating to draft orders/email confirmations have been reported by others.
Thanks for bringing this to us - please keep an eye out for a response from me or one of my colleagues.
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog