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

[RFC]: Suport Apollo Persisted Cache #10086

Open
1 task done
dthyresson opened this issue Mar 1, 2024 · 0 comments
Open
1 task done

[RFC]: Suport Apollo Persisted Cache #10086

dthyresson opened this issue Mar 1, 2024 · 0 comments

Comments

@dthyresson
Copy link
Contributor

Summary

Simple persistence for all Apollo Client 3.0 cache implementations.

See: https://github.com/apollographql/apollo-cache-persist

In response to the Forums discussion here: https://community.redwoodjs.com/t/persist-apollo-cache-to-local-storage/5699 Redwood should consider better support for persisting the Apollo cache via local or other storage -- and restoring it.

Motivation

While there are cache-first fetch policies, there are cases when an app may want to cache and restore.

There is a way to persist the cache (see: https://github.com/redwoodjs/redwood/blob/8b870b289557d19d1685865ce1766f5f7572dcce/docs/docs/graphql/caching.md#persisting-cache) but the DX could be easier .... and also let the useCache hook persist and restore.

Detailed proposal

We'd have to modify the Apollo cache in the framework but be wary of always importing the persist cache package, so may need to dynamically import in a similar way SSELink is imported.

Are you interested in working on this?

  • I'm interested in working on this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants