A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I am finding that there is about a 20 second delay between the mutation of an item and the queryability of that mutation in the GraphQL API. I mutate an order by adding a tag, and then I query all orders without that tag; GraphQL responds with that very order up until around 20 seconds have passed. The kicker is that the response even acknowledges that the order contains the tag! Here's an example of my query and the response:
Query:
{ orders(query: "-tag:giftcardsCreated AND unpaid:false AND created_at:>='2021-12-08T11:40:18-08:00'", first: 5) {edges {cursornode {idtagslineItems (first: 45){edges {node {skuquantity}}}}}}}
{"extensions": {etc.},"data": {"orders": {"edges": [{"cursor": "(cursor)","node": {"lineItems": {"edges": [{"node": {"quantity": 3,"sku": "(sku)"}}]},"id": "gid://shopify/Order/(id)","email": "(email)","tags": ["giftcardsCreated"]}}]}}}
Hey @CameronKaiser
Many thanks for raising this and for all the detail provided, it really helped!
I took a deep dive into this and curiously after a series of repeated attempts, I am not able to replicate. I used both ordersUpdate and the tagsAdd mutation on Orders in my attempts to replicate and then called your same orders query.
When I called either of said mutations, I immediately would call the subsequent orders query and am returned no data in the response when those same query parameters - I wasn't seeing any orders using "tags: giftcardsCreated" that were returned when applying the not operator.
I noted that amending the orders query to remove the not operator and change it to tag:giftcardsCreated whilst keeping the other params the same actually did return my orders with my newly applied tag which was expected.
I noted a slight delay when querying orders that had previously had tags applied with tagsAdd actually in some cases, but we'd be talking within the realms of milli seconds.
I was wondering if this was still an issue for you and if so, had you any x-request-id's for any of these queries/mutations you'd raised? There may be a little more light shed on this that we can ascertain via the logs. Thanks!