I'm using Apollo's Client and trying to evict the address object from the cache.
Using evict does remove it from the cache (confirmed by Apollo Client Dev Tools), however, it looks like the component does not rerender and the address would still be there unless I refresh the page.
deleteAddress({
variables: { id: data.address.id },
update: (cache) => {
cache.evict({
id: "Address:" + data.address.id,
});
cache.gc();
},
})
}
Specifically, I tried the following 2 methods, both removed the object from the cache but neither re-render.
cache.evict({
id: "Address:" + data.address.id,
});
cache.gc();
cache.evict({
id: cache.identify(data?.address),
});