Skip to content

Are additionalTypenames work with graphcache? #1242

Answered by kitten
RIP21 asked this question in Q&A
Discussion options

You must be logged in to vote

No, Graphcache is a normalised cache with the aim to reduce refetches and to share data where possible. (Although with a new addition in the populate exchange this may change in the future, in terms of a slow migration path and alternatives becoming available) But you do have several options:

  • manually trigger a refetch. I'll just put this out there since it's intuitive and does the same as additionalTypenames
  • add an updater that uses cache.invalidate to remove the cached list and force Graphcache to refetch it
  • add an updater that tells Graphcache how to add your new item to the list

There's more details on updaters on this docs page: https://formidable.com/open-source/urql/docs/graphcac…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@RIP21
Comment options

@RIP21
Comment options

@kitten
Comment options

Answer selected by RIP21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants