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(react): Fix execute functions' state change being discarded after pause change (#3323)

authored by

Phil Pluckthun and committed by
GitHub
2acc6298 7c509f48

+7 -2
+5
.changeset/serious-balloons-cheat.md
··· 1 + --- 2 + 'urql': patch 3 + --- 4 + 5 + Fix edge case that causes execute functions from `useQuery` and `useSubscription` to fail when they’re called in their state after a render that changes `pause`. This would previously cause internal dependencies to be outdated and the source to be discarded immediately in some cases.
+1 -1
packages/react-urql/src/hooks/useQuery.ts
··· 376 376 cache, 377 377 request, 378 378 suspense, 379 - getSnapshot, 380 379 args.requestPolicy, 381 380 args.context, 381 + args.pause, 382 382 ] 383 383 ); 384 384
+1 -1
packages/react-urql/src/hooks/useSubscription.ts
··· 300 300 301 301 deferDispatch(setState, state => [source, state[1], deps]); 302 302 }, 303 - [client, args.context, request] 303 + [client, request, args.context, args.pause] 304 304 ); 305 305 306 306 return [currentResult, executeSubscription];