apollo
apollo copied to clipboard
Invoking "useMutation" with onDone hook does not decrement global mutation loading
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
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?
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