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): case where a mutation would also be counted in the loop-protection (#2761)

authored by

Jovi De Croock and committed by
GitHub
15482d89 7d9ba145

+8 -1
+5
.changeset/flat-feet-look.md
··· 1 + --- 2 + "@urql/exchange-graphcache": patch 3 + --- 4 + 5 + Fix case where a mutation would also be counted in the loop-protection, this prevented partial queries from initiating refetches
+3 -1
exchanges/graphcache/src/cacheExchange.ts
··· 103 103 // Upon completion, all dependent operations become reexecuting operations, preventing 104 104 // them from reexecuting prior operations again, causing infinite loops 105 105 const _reexecutingOperations = reexecutingOperations; 106 - (reexecutingOperations = dependentOperations).add(operation.key); 106 + if (operation.kind === 'query') { 107 + (reexecutingOperations = dependentOperations).add(operation.key); 108 + } 107 109 (dependentOperations = _reexecutingOperations).clear(); 108 110 }; 109 111