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

[Cache] Automatically trigger refetches of modified values #1298

Open
macmillen opened this issue Apr 29, 2024 · 1 comment
Open

[Cache] Automatically trigger refetches of modified values #1298

macmillen opened this issue Apr 29, 2024 · 1 comment

Comments

@macmillen
Copy link
Contributor

macmillen commented Apr 29, 2024

Describe the feature

It would be really useful to invalidate the cache automatically for queries that depend on the updated data and have the same __typename.

Example:

  • item with __typename Book gets deleted -> refetch query with list of books

That topic was already previously talked about: (#58 (comment))

[...] Would you want a way to automatically trigger refetches of the deleted value or is that something you would do by hand? Or just the next time the query is fired?

It would be nice to have a similar functionality what urqls GraphCache provides:
https://commerce.nearform.com/open-source/urql/docs/graphcache/normalized-caching/

Another thing to keep in mind is how we could invalidate the SvelteKit load functions automatically whenever a GraphQL mutation gets triggered.

Criticality

cool improvement, my projects will benefit from it

@AlecAivazis
Copy link
Collaborator

I really like this idea and it piggy backs on the exact same infrastructure that we need to do #1225. If this is something you have the time/energy to take on let me know - it should be a fun one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants