Dan
Dan

Reputation: 5070

How do I invalidate all objects of a certain type at once?

In apollo-client, cache.modify() lets me invalidate individual objects by ID.

However, I need to invalidate all objects of a certain type at once without knowing individual IDs or having a top-level query that contains those objects.

E.g. user clicks "Refresh Books" → invalidate all queries that involve a __typename: "Book" reference or object.

How would I do this?

Edit: URQL supports exactly what I am looking for: Invalidating a type

Upvotes: 0

Views: 13

Answers (0)

Related Questions