From ffb76c84284864d4bb4de255e941e17abcfbce9e Mon Sep 17 00:00:00 2001 From: mobsean Date: Fri, 7 Jun 2024 11:50:52 +0200 Subject: [PATCH] add nextTick before event trigger --- packages/vue-apollo-composable/src/useMutation.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vue-apollo-composable/src/useMutation.ts b/packages/vue-apollo-composable/src/useMutation.ts index 28654dd2..fb6ccc6d 100644 --- a/packages/vue-apollo-composable/src/useMutation.ts +++ b/packages/vue-apollo-composable/src/useMutation.ts @@ -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, })