Closed jerelmiller closed 1 month ago
Latest commit: f6466d84d2adf2115226e48d5d675816e9def987
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Fixes #12028
Ensures that fragments registered with the fragment registry can be looked up by the data masking algorithm.
This change adds a new
lookupFragment
API in the base cache class that allows custom caches to provide lookups for fragments by name. For example,InMemoryCache
has the fragment registry, so it overrides the base implementation and uses the fragment registry to lookup a fragment by name.As a part of this, I've moved the implementation of
maskFragment
andmaskOperation
over toQueryManager
where I believe it fits better. This makes it a much more private API and makes it much more obvious that custom cache implementations don't need to interact with these APIs directly since we want the core Apollo Client controlling the implementation.