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.

(graphcache) - Fix nullable lists with schema awareness (#1983)

authored by

Phil Pluckthun and committed by
GitHub
847e9884 cfd8f4dd

+9 -2
+5
.changeset/polite-jobs-call.md
··· 1 + --- 2 + '@urql/exchange-graphcache': patch 3 + --- 4 + 5 + Fix regression from [#1869](https://github.com/FormidableLabs/urql/pull/1869) that caused nullable lists to always cause a cache miss, if schema awareness is enabled.
+4 -2
exchanges/graphcache/src/operations/query.ts
··· 500 500 if (childResult === undefined && !_isListNullable) { 501 501 return undefined; 502 502 } else { 503 - ctx.partial = ctx.partial || _isListNullable; 503 + ctx.partial = 504 + ctx.partial || (childResult === undefined && _isListNullable); 504 505 data[i] = childResult != null ? childResult : null; 505 506 hasChanged = hasChanged || data[i] !== prevData![i]; 506 507 } ··· 565 566 if (childLink === undefined && !_isListNullable) { 566 567 return undefined; 567 568 } else { 568 - ctx.partial = ctx.partial || _isListNullable; 569 + ctx.partial = 570 + ctx.partial || (childLink === undefined && _isListNullable); 569 571 newLink[i] = childLink || null; 570 572 hasChanged = hasChanged || newLink[i] !== prevData![i]; 571 573 }