Skip to content

Commit

Permalink
fix: useMutations onDone Event hook gets triggered too early (#1559)
Browse files Browse the repository at this point in the history
  • Loading branch information
mobsean authored Aug 14, 2024
1 parent d1098be commit f0ab708
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vue-apollo-composable/src/useMutation.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -100,6 +100,7 @@ export function useMutation<
: undefined,
})
loading.value = false
await nextTick()
doneEvent.trigger(result, {
client,
})
Expand Down

0 comments on commit f0ab708

Please sign in to comment.