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): Fix regression causing `pause` argument to not be reactive (#3595)

Co-authored-by: Phil Pluckthun <phil@kitten.sh>

authored by

arkandias
Phil Pluckthun
and committed by
GitHub
41303ff8 0a57e27f

+13 -2
+5
.changeset/eight-mirrors-sing.md
··· 1 + --- 2 + '@urql/vue': patch 3 + --- 4 + 5 + Fix regression causing `pause` argument on `useQuery` and `useSubscription` to not be reactive
+4 -1
packages/vue-urql/src/useQuery.ts
··· 1 1 /* eslint-disable react-hooks/rules-of-hooks */ 2 2 3 3 import type { WatchStopHandle, Ref } from 'vue'; 4 + import { isRef } from 'vue'; 4 5 import { shallowRef, ref, watchEffect, reactive } from 'vue'; 5 6 6 7 import type { Subscription, Source } from 'wonka'; ··· 253 254 const operation: Ref<Operation<T, V> | undefined> = ref(); 254 255 const extensions: Ref<Record<string, any> | undefined> = ref(); 255 256 256 - const isPaused = ref(!!unref(args.pause)); 257 + const isPaused: Ref<boolean> = isRef(_args.pause) 258 + ? _args.pause 259 + : ref(!!_args.pause); 257 260 258 261 const input = shallowRef({ 259 262 request: createRequest<T, V>(unref(args.query), unref(args.variables) as V),
+4 -1
packages/vue-urql/src/useSubscription.ts
··· 4 4 import { pipe, subscribe, onEnd } from 'wonka'; 5 5 6 6 import type { WatchStopHandle, Ref } from 'vue'; 7 + import { isRef } from 'vue'; 7 8 import { ref, shallowRef, watchEffect, reactive } from 'vue'; 8 9 9 10 import type { ··· 253 254 const extensions: Ref<Record<string, any> | undefined> = ref(); 254 255 255 256 const scanHandler = ref(handler); 256 - const isPaused = ref(!!unref(args.pause)); 257 + const isPaused: Ref<boolean> = isRef(_args.pause) 258 + ? _args.pause 259 + : ref(!!_args.pause); 257 260 258 261 const input = shallowRef({ 259 262 request: createRequest<T, V>(unref(args.query), unref(args.variables) as V),