Triggering Watchers After Removing Objects From Apollo - iOS

Hi there,

I’ve looked into removeObject(for:) for removing objects from the cache after a deletion mutation. Am I right in thinking it doesn’t notify watchers?

I have a paginated list which allows deletion and I’d like to avoid refreshing the list manually after the deletion mutation completes but in my testing, removeObject doesn’t trigger my list’s watcher.

If watcher triggering is not available, what is the best way to invalidate the cache without having to refresh the whole list query? Here is a related issue from way back: Cannot invalidate cache items · Issue #362 · apollographql/apollo-ios · GitHub

My call tree when attempting to remove the object:

  1. ApolloStore line 261 (sorry for no link but I can only post 2 links)
  2. InMemoryNormalizedCache: apollo-ios/InMemoryNormalizedCache.swift at main · apollographql/apollo-ios · GitHub
  3. RecordSet line 14

It doesn’t look like any of these locations notify watchers like update(query and the like do.