You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of our mutations return sensitive data, like access token. Their paths also contain sensitive data, like user email and password used for authorization mutation. We don't want to keep them in the normalized SQL cache on a disk, so right now we attach ApolloCacheHeaders.DO_NOT_STORE header, otherwise we see the path, access token etc. in the cache even when setting CacheKey.NO_KEY for these types in the CacheKeyResolver.
However, those mutations also return data that we would like to cache, like the general user profile. We can distinguish objects that we want to cache or not based on their __typename field, and they're not nested.
Is there any way to cache only specific objects from the mutation, without persisting mutation path (which contains email/password since they're parameters of the mutation) and unwanted parts of the response? For example for
we'd like to only put userData under ID key in the normalized cache, and drop everything else, including token, email or password. The reason is we also have query UserData(id: Id) and we'd like to be able to execute it but only use cached data (which we'd update using other queries/mutations). Is this possible?
The text was updated successfully, but these errors were encountered:
Some of our mutations return sensitive data, like access token. Their paths also contain sensitive data, like user email and password used for authorization mutation. We don't want to keep them in the normalized SQL cache on a disk, so right now we attach
ApolloCacheHeaders.DO_NOT_STORE
header, otherwise we see the path, access token etc. in the cache even when settingCacheKey.NO_KEY
for these types in theCacheKeyResolver
.However, those mutations also return data that we would like to cache, like the general user profile. We can distinguish objects that we want to cache or not based on their
__typename
field, and they're not nested.Is there any way to cache only specific objects from the mutation, without persisting mutation path (which contains email/password since they're parameters of the mutation) and unwanted parts of the response? For example for
we'd like to only put
userData
under ID key in the normalized cache, and drop everything else, including token, email or password. The reason is we also havequery UserData(id: Id)
and we'd like to be able to execute it but only use cached data (which we'd update using other queries/mutations). Is this possible?The text was updated successfully, but these errors were encountered: