urql-graphql / urql

The highly customizable and versatile GraphQL client with which you add on features like normalized caching as you grow.
https://urql.dev/goto/docs
MIT License
8.57k stars 444 forks source link

fix(graphcache): Fix typo in owned data null resolution for resolvers #3371

Closed kitten closed 11 months ago

kitten commented 11 months ago

Resolves #3370

Summary

This fixes a typo in an inverted condition for an owned data check in resolveResolverResult. The equivalent check in resolveLink is isOwnedData && prevData === null, i.e. when a prior result was null it keeps the field set to null.

Instead, the resolver did the opposite and hence turned a first resolution of a prevData === null result into a nulled value, i.e. preventing subsequent results from succeeding.

Set of changes