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): prioritise context.suspense (#3427)

authored by

Jovi De Croock and committed by
GitHub
f2c59c56 3fe5b14d

+12 -2
+6
.changeset/real-geese-grow.md
··· 1 + --- 2 + 'urql': patch 3 + '@urql/preact': patch 4 + --- 5 + 6 + Prioritise `context.suspense` and fallback to checking `client.suspense`
+3 -1
packages/preact-urql/src/hooks/useQuery.ts
··· 212 212 } 213 213 214 214 const isSuspense = (client: Client, context?: Partial<OperationContext>) => 215 - client.suspense && (!context || context.suspense !== false); 215 + context && context.suspense !== undefined 216 + ? !!context.suspense 217 + : client.suspense; 216 218 217 219 const sources = new Map<number, Source<OperationResult>>(); 218 220
+3 -1
packages/react-urql/src/hooks/useQuery.ts
··· 175 175 > = [UseQueryState<Data, Variables>, UseQueryExecute]; 176 176 177 177 const isSuspense = (client: Client, context?: Partial<OperationContext>) => 178 - client.suspense && (!context || context.suspense !== false); 178 + context && context.suspense !== undefined 179 + ? !!context.suspense 180 + : client.suspense; 179 181 180 182 /** Hook to run a GraphQL query and get updated GraphQL results. 181 183 *