Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoking "useMutation" with onDone hook does not decrement global mutation loading #1484

Open
tsiotska opened this issue Jun 20, 2023 · 2 comments

Comments

@tsiotska
Copy link
Contributor

Describe the bug
Invoking "useMutation" with onDone hook does not decrement global mutation loading (useGlobalMutationLoading)
Will investigate and provide more details or fix soon

workaround
use ".then()" or update function

Versions
vue: 3.2.41
vue/apollo-composable: 4.0.0-beta.1
@apollo/client: 3.7.14

@tsiotska
Copy link
Contributor Author

tsiotska commented Jun 21, 2023

Update: error was caused because in onDone hook body i destroyed component that used mutation (closed modal window), thus i lost global loading tracking.
But shouldn't "onDone" be invoked after loading and mutation are finished?

@mobsean
Copy link
Contributor

mobsean commented Jun 6, 2024

I also ran into this issue.

I know it´s not beautiful, but it does the trick.

import { nextTick } from 'vue'

.....

onDone(async () => {
  await nextTick()
   .......
})

PR #1559 should fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants