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

Additional Cache key significant properties #232

Open
ivansky opened this issue May 29, 2020 · 1 comment
Open

Additional Cache key significant properties #232

ivansky opened this issue May 29, 2020 · 1 comment
Labels
📕 cache Feature requests related to the cache project-apollo-client (legacy) LEGACY TAG DO NOT USE

Comments

@ivansky
Copy link

ivansky commented May 29, 2020

Add additional Cache significant properties from context like server extraCacheKeyData.

Use Case:
There are at least two properties that are sent by headers and receive different data from GraphQL Server:

  1. Language
  2. Device type (mobile / desktop)

Example of usage:
It needs to add somehow to cache lifecycle additional properties that affect cache data.
Something like:

someCacheKeyExtendPlugin({
  language: (context) => context.language,
  deviceType: (context) => context.deviceType,
})

or

someCacheKeyExtendPlugin((context) => {
  language: context.language,
  deviceType: context.deviceType,
})

Then if user change language, the data should be reloaded and show some sign of loading for UX.

@ghost
Copy link

ghost commented Jul 6, 2023

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📕 cache Feature requests related to the cache project-apollo-client (legacy) LEGACY TAG DO NOT USE
Projects
None yet
Development

No branches or pull requests

3 participants