Skip to content

Commit 76f19f6

Browse files
committed
fix: use shallowRef for apollo query
1 parent 21fca98 commit 76f19f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/vue-apollo-composable/src/useQuery.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
getCurrentInstance,
99
onBeforeUnmount,
1010
nextTick,
11+
shallowRef,
1112
} from 'vue-demi'
1213
import { DocumentNode } from 'graphql'
1314
import type {
@@ -218,7 +219,7 @@ export function useQueryImpl<
218219

219220
// Query
220221

221-
const query: Ref<ObservableQuery<TResult, TVariables> | null | undefined> = ref()
222+
const query: Ref<ObservableQuery<TResult, TVariables> | null | undefined> = shallowRef()
222223
let observer: ObservableSubscription | undefined
223224
let started = false
224225
let ignoreNextResult = false

0 commit comments

Comments
 (0)