Skip to content

[Cache] Automatically trigger refetches of modified values #1298

@macmillen

Description

@macmillen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions