$chiubaca / notes / fleeting / 2021-07-26
  • Fun with the apollo cache today. My man Ben Awad with knowledge again. Basicly three ways to utalise the apollo cache
    • adding a new record automatically updates the apollo cache
    • adding a refetch policy on on mutations forces the cache to update, however this means there are two network requests. not the end of the world…
    • you can manually ammend the apollo cache on mutation with the update callback, within this callback you have access to the cache object which has some additional methods you can utalised like edit and writeQuery.
Edit on GitHub ✏️

Hey I'm Alex Chiu 👋. These are my notes for literally anything.

I'm using the Zettelkasten method to organise my thoughts here.

My more polished writings are published to my main blog at chiubaca.com

Follow me on: Github / X (Twitter) / Mastodon / LinkedIn