mirror of
https://github.com/vuejs/apollo.git
synced 2026-02-01 14:37:18 +00:00
fix: useMutations onDone Event hook gets triggered too early (#1559)
This commit is contained in:
parent
d1098bee4f
commit
f0ab70883e
@ -1,6 +1,6 @@
|
||||
import { DocumentNode } from 'graphql'
|
||||
import { MutationOptions, OperationVariables, FetchResult, TypedDocumentNode, ApolloError, ApolloClient } from '@apollo/client/core/index.js'
|
||||
import { ref, onScopeDispose, isRef, Ref, getCurrentScope, shallowRef } from 'vue-demi'
|
||||
import { ref, onScopeDispose, isRef, Ref, getCurrentScope, shallowRef, nextTick } from 'vue-demi'
|
||||
import { useApolloClient } from './useApolloClient'
|
||||
import { ReactiveFunction } from './util/ReactiveFunction'
|
||||
import { useEventHook } from './util/useEventHook'
|
||||
@ -100,6 +100,7 @@ export function useMutation<
|
||||
: undefined,
|
||||
})
|
||||
loading.value = false
|
||||
await nextTick()
|
||||
doneEvent.trigger(result, {
|
||||
client,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user