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): Record dependencies for __typename accesses #3335

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Jul 25, 2023

Summary

This changes the expected behaviour for when dependencies are recorded for caches accesses.

Note: Dependencies are basically entity or field keys marking a cache read or write. When a cache write updates a dependency, then all cache reads (i.e. queries) that have the same cache dependency will be updated accordingly, i.e. re-queried. This is how Graphcache issues updates to queries after cache writes.

While this wasn't a bug, any usage of cache.resolve(entity, '__typename') wouldn't actually record a dependency, which could cause confusion. The exception has now been removed.

Set of changes

  • Remove dependency exception for accessing __typename on entities

@kitten kitten merged commit 449c476 into main Jul 25, 2023
6 checks passed
@kitten kitten deleted the fix/graphcache-resolve-typename branch July 25, 2023 16:11
@github-actions github-actions bot mentioned this pull request Jul 25, 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