Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(graphcache): Fix reference equality of lists not always being preserved #3228

Merged
merged 5 commits into from
May 30, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented May 30, 2023

Summary

A prior fix in #3165 prevented us from mixing API and Graphcache’s data. While we previously avoided modifying API data or prior results from Graphcache, this created new corner cases that were hard to cover.

Specifically, nested lists are hard to diff against prior results as they can be re-entered, null must be skipped, and there’s more cases where comparing data and returning previous results could be dangerous and lead to the wrong outcome.

This PR aims to start addressing this issue but may forget to cover some corner cases.

Set of changes

  • Restore and create lists against prior data

@urql-graphql urql-graphql deleted a comment from vercel bot May 30, 2023
@urql-graphql urql-graphql deleted a comment from vercel bot May 30, 2023
@kitten kitten merged commit 81ce770 into main May 30, 2023
@kitten kitten deleted the fix/reference-equal-lists branch May 30, 2023 20:50
@github-actions github-actions bot mentioned this pull request May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant