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(graphcache): Fix offlineExchange’s failed queue not being filtered for teardowns (#3236)

authored by

Phil Pluckthun and committed by
GitHub
0f4fadd3 9bf55832

+9
+5
.changeset/pretty-dodos-happen.md
··· 1 + --- 2 + '@urql/exchange-graphcache': patch 3 + --- 4 + 5 + Fix torn down queries not being removed from `offlineExchange`’s failed queue on rehydration.
+4
exchanges/graphcache/src/offlineExchange.ts
··· 230 230 onPush(operation => { 231 231 if (operation.kind === 'query' && !hasRehydrated) { 232 232 failedQueue.push(operation); 233 + } else if (operation.kind === 'teardown') { 234 + for (let i = failedQueue.length - 1; i >= 0; i--) 235 + if (failedQueue[i].key === operation.key) 236 + failedQueue.splice(i, 1); 233 237 } 234 238 }) 235 239 ),