Since Apollo client 3.0 a normalised object can be deleted from the cache using cache.evict, like so:
{
update: (cache, { data: updateData }) => {
if (isNil(updateData)) return
const { id } = updateData.removeSomething
cache.evict({ id: `Something:${id}` })
cache.gc()
}
}
However, deleting it in this manner still seems to leave dangling pointers to the object in lists it appeared in. Appearing like so in the cache:
[{__ref: "Something:9180d367-b018-46c1-b9cf-049258408fd8"}]
How can these references to the object be removed without knowing the parent ID?
Edit: This pull request answers it to a degree, but doesn't find anything with the child ID.