Update Cell after mutation

Hello,

I’m new to Apollo, mostly I have used Redux so far.

I have Entity form in cell A and Entity list in cell B. Once I update Entity, how I can force cell B to re-fetch data so list can be updated.
I have found Reading and writing data to the cache - Apollo GraphQL Docs but kind of lost.

Thanks for any help!

1 Like

This thread might be helpful: How to trigger a cell refresh

1 Like

Thanks, I had tried that first before asking. It kind of works but it keeps refreshing always. I only want to fetch fresh data only when update is made. i.e after mutation

I think, I was looking for something like this. I will try this out,

3 Likes

Actually, Success component has a prop called “refetch”, which is a function.
When you save or do whatever you’re doing, just:

refetch()

And that’s all. :slight_smile:

EDIT:
Wow, 2 years later. :smiley:
Sry about that, maybe it wasn’t there back in the day when the question was asked, but hope it can help future folks who stumble here like I did. :slight_smile:

1 Like