Mirror: The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(vue): deep options reactivity in subscriptions (#3616)

authored by

Jovi De Croock and committed by
GitHub
1bb23784 92fdbd2e

+10 -4
+5
.changeset/many-kings-double.md
··· 1 + --- 2 + '@urql/vue': patch 3 + --- 4 + 5 + Fix deep options reactivity for subscriptions
+1 -2
packages/vue-urql/src/useQuery.ts
··· 1 1 /* eslint-disable react-hooks/rules-of-hooks */ 2 2 3 3 import type { Ref, WatchStopHandle } from 'vue'; 4 - import { reactive } from 'vue'; 5 - import { isRef, ref, shallowRef, watch, watchEffect } from 'vue'; 4 + import { isRef, ref, shallowRef, watch, watchEffect, reactive } from 'vue'; 6 5 7 6 import type { Subscription, Source } from 'wonka'; 8 7 import { pipe, subscribe, onEnd } from 'wonka';
+4 -2
packages/vue-urql/src/useSubscription.ts
··· 4 4 import { pipe, subscribe, onEnd } from 'wonka'; 5 5 6 6 import type { Ref, WatchStopHandle } from 'vue'; 7 - import { isRef, ref, shallowRef, watch, watchEffect } from 'vue'; 7 + import { isRef, ref, shallowRef, watch, watchEffect, reactive } from 'vue'; 8 8 9 9 import type { 10 10 Client, ··· 239 239 R = T, 240 240 V extends AnyVariables = AnyVariables, 241 241 >( 242 - args: UseSubscriptionArgs<T, V>, 242 + _args: UseSubscriptionArgs<T, V>, 243 243 handler?: MaybeRef<SubscriptionHandler<T, R>>, 244 244 client: Ref<Client> = useClient(), 245 245 stops: WatchStopHandle[] = [] 246 246 ): UseSubscriptionResponse<T, R, V> { 247 + const args = reactive(_args) as UseSubscriptionArgs<T, V>; 248 + 247 249 const data: Ref<R | undefined> = ref(); 248 250 const stale: Ref<boolean> = ref(false); 249 251 const fetching: Ref<boolean> = ref(false);