Invalidating a cached query based on it's members
July 23, 2020 at 4:49pmInvalidating a cached query based on it's members
July 23, 2020 at 4:49pmI'm trying to figure out if it's possible to create a Link that will keep a record of the objects that result from a query and refetch that query if those objects are invalidated somehow?
For example, the age old graphql problem of filtered lists of items. If that list query could be refetched if any object in the list changed then the item that should no longer be present would be removed.
Another example, let's say I have a list of items that are currently waiting on some response from backoffice staff. When that response is ready I could notify the client that an object has changed and every query in the client that cares about that object would refetch.
This seems like something that should be possible with Apollo Links since they are based on Observables, is this correct?