You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an issue related to the sequence of request execution involving a Query request and a mutation. If the execution time of the Query is longer than the mutation request's execution time, it leads to a scenario where:
The Query starts.
The mutation starts.
The mutation ends.
The Query ends.
As a result, the final response lacks the data I need, and updateQueryData doesn't execute as expected.
Could you please suggest the best way to resolve this problem?
My current solution involves waiting for the Query request to complete before executing updateQueryData. However, waiting has its downsides, and I'm wondering if I might be approaching this incorrectly or if there's another way to update the cache more efficiently.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've encountered an issue related to the sequence of request execution involving a Query request and a mutation. If the execution time of the Query is longer than the mutation request's execution time, it leads to a scenario where:
The Query starts.
The mutation starts.
The mutation ends.
The Query ends.
As a result, the final response lacks the data I need, and updateQueryData doesn't execute as expected.
Here's the structure of my API:
Could you please suggest the best way to resolve this problem?
My current solution involves waiting for the Query request to complete before executing updateQueryData. However, waiting has its downsides, and I'm wondering if I might be approaching this incorrectly or if there's another way to update the cache more efficiently.
Ideally, I would like to execute updateQueryData at the end of the mutation and then incorporate changes into the Query response upon its completion.
Additionally, I should clarify that optimistic updates are not an option for me; I require the response from the mutation.
Beta Was this translation helpful? Give feedback.
All reactions