From bfb5d08c694b1a4aa2ad28094cff241cdf7779aa Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Fri, 29 Nov 2019 16:33:20 +0100 Subject: [PATCH] feat(useMutation): called ref --- packages/vue-apollo-composable/src/useMutation.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/vue-apollo-composable/src/useMutation.ts b/packages/vue-apollo-composable/src/useMutation.ts index 00df3de..7bebcbd 100644 --- a/packages/vue-apollo-composable/src/useMutation.ts +++ b/packages/vue-apollo-composable/src/useMutation.ts @@ -22,6 +22,7 @@ export function useMutation< const loading = ref(false) const error = ref(null) + const called = ref(false) // Apollo Client const { resolveClient } = useApolloClient() @@ -36,6 +37,7 @@ export function useMutation< const client = resolveClient(currentOptions.clientId) error.value = null loading.value = true + called.value = true try { const result = await client.mutate({ mutation: document, @@ -58,5 +60,6 @@ export function useMutation< mutate, loading, error, + called, } } \ No newline at end of file