HoudiniGraphql / houdini

The disappearing GraphQL framework
http://www.houdinigraphql.com
MIT License
912 stars 98 forks source link

[Cache] Automatically trigger refetches of modified values #1298

Open macmillen opened 6 months ago

macmillen commented 6 months ago

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:

That topic was already previously talked about: (https://github.com/HoudiniGraphql/houdini/issues/58#issuecomment-1343333432)

[...] 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 commented 4 months ago

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.