apollographql / apollo-client

:rocket:  A fully-featured, production ready caching GraphQL client for every UI framework and GraphQL server.
https://apollographql.com/client
MIT License
19.38k stars 2.66k forks source link

Move check for whether data masking is enabled to `ObservableQuery` #11913

Closed jerelmiller closed 4 months ago

jerelmiller commented 4 months ago

The interaction between the client and the cache to determine whether the user has enabled data masking is very awkward. The current implementation relies on the client setting a property on the cache after the cache was created. While this works, this feels a bit leaky.

This change removes the property from the cache object and instead does the check in ObservableQuery itself before calling cache.maskDocument which is a bit more natural since ObservableQuery has access to this value.

changeset-bot[bot] commented 4 months ago

⚠️ No Changeset found

Latest commit: 2cb5a8c8bd1c3af5a25e16ed1bfbf44866d5329c

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.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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