Can you cancel paused mutations? #8667
Unanswered
cmdecker95
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can you cancel a paused mutation? My use case is that I run update mutations to any one resource on the backend serially (see the docs on mutation scopes). If I run a successful delete mutation, I want it to cancel the remaining paused update mutations to that resource.
For example, imagine a queue of mutations for any single Todo, let's say ID 1:
Above, I want to know if I can cancel Mutation 4 (and beyond), since I don't want to attempt an update to a successfully deleted resource.
Here's an example of the API I'm envisioning (in case it doesn't exist yet), which I'm suggesting be added as
queryClient.cancelMutations
:EDIT: In PR #8673, I opted to specifically cancel mutations in a given scope only if the mutation is paused. Therefore, I chose to instead name this query client method
cancelPausedMutations
, which follows the naming pattern set byresumePausedMutations
.Beta Was this translation helpful? Give feedback.
All reactions