I'm familar with the various ways to perform updates and inserts when it comes to ApolloClient cache, but this question is about deletes.
Let's say the user chooses to delete "note" item with an "id" of 123. I want "note:123" deleted altogether within the cache. Is there a way to do this?
For example, in the case of doing updates, I often use writeFragment
to update a specific note, and that does what I expect, updating that note across all queries. However, I notice a conspicuous lack of a deleteFragment
method. Am I missing something?
It looks like ApolloClient v3 lets you use evict() for this. As far as I know, this is the only way to delete an item without needing to know every combination of queries and variables it's appeared under.