Skip to content

Commit

Permalink
fix: use shallowRef for apollo query
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Nov 29, 2023
1 parent 21fca98 commit 76f19f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/vue-apollo-composable/src/useQuery.ts
Expand Up @@ -8,6 +8,7 @@ import {
getCurrentInstance,
onBeforeUnmount,
nextTick,
shallowRef,
} from 'vue-demi'
import { DocumentNode } from 'graphql'
import type {
Expand Down Expand Up @@ -218,7 +219,7 @@ export function useQueryImpl<

// Query

const query: Ref<ObservableQuery<TResult, TVariables> | null | undefined> = ref()
const query: Ref<ObservableQuery<TResult, TVariables> | null | undefined> = shallowRef()
let observer: ObservableSubscription | undefined
let started = false
let ignoreNextResult = false
Expand Down

1 comment on commit 76f19f6

@rebz
Copy link

@rebz rebz commented on 76f19f6 Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixed some proxy errors we were receiving from Apollo Cache updates. Thanks!

Please sign in to comment.