refactor(web): move archiveAll cache invalidation into apollo client config

This commit is contained in:
Pujit Mehrotra
2024-10-23 12:49:02 -04:00
parent 15a1a3ac15
commit ebd671e7b6
3 changed files with 29 additions and 15 deletions
+1 -9
View File
@@ -42,15 +42,7 @@ const notifications = computed(() => {
return useFragment(NOTIFICATION_FRAGMENT, result.value?.notifications.list);
});
const { mutate: archiveAll, loading: archivingAll } = useMutation(
archiveAllNotifications,
{
update: (cache) => {
cache.evict({ fieldName: "notifications" });
cache.gc();
},
}
);
const { mutate: archiveAll, loading: archivingAll } = useMutation(archiveAllNotifications);
watch(error, (newVal) => {
console.log("[sidebar error]", newVal);