According to the documentation, when making an orderEditCommit mutation, the order object in the response is “The order with changes applied.”. However, I am finding that this is not accurate. The response doesn’t reflect changes I have made to a line item quantity, nor the subsequent changes to the totalPriceSet. The changes ARE being made, however, because I can see them on the order in the admin UI.
Is there something I am missing in order to get accurate order data in the response from orderEditCommit as the documentation indicates that I should?
I’m actually finding it’s not just the response from orderEditCommit, even retrieving the order via the API is still showing the original order even though the changes are reflected in the UI. The UI shows one item from the order removed (qty set to 0), a new total, and a refund owed. None of this is reflected in the response via the GraphQL API, the lineItems, subtotalPriceSet, and totalPriceSet are unchanged even several minutes later. Is there something I am missing?
Hey @ce_nort
It looks like this might be cache related in some way since the changes are showing up correctly in the admin UI. To troubleshoot this, can you try using a separate API client like the admin GraphiQL app to query the order after making changes to see if it returns the updated data. This would help determine if the issue is potentially local to your implementation.
Another thing to check, if you query the product again after some time has passed (a few minutes or hours), does it eventually returns the accurate results?
If the tests above don’t lead to a resolution or point to anything local, reply here and if possible share a couple of the request-ids from the response headers and examples of the incorrect responses. I’m happy to look further at this.
For anyone finding this issue down the road, the problem was that the original value fields on the order (e.g. lineItem.quantity, totalPriceSet, etc) don’t actually change. I was needing to query the “current” fields (e.g., lineItem.currentQuantity, currentTotalPriceSet) to get the changed values.