Skip to content

Commit

Permalink
feat(useMutation): called ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Nov 29, 2019
1 parent 9aa26a9 commit bfb5d08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vue-apollo-composable/src/useMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function useMutation<

const loading = ref<boolean>(false)
const error = ref<Error>(null)
const called = ref<boolean>(false)

// Apollo Client
const { resolveClient } = useApolloClient()
Expand All @@ -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,
Expand All @@ -58,5 +60,6 @@ export function useMutation<
mutate,
loading,
error,
called,
}
}

0 comments on commit bfb5d08

Please sign in to comment.