Skip to content

How to correctly do an update of the graphcache's paginated list after the create mutation? #3211

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

You must be logged in to vote

Just to address the questions you had separately as well,

Is it the correct way how to update the pagination list? Maybe this flow could be improved?

Yes. You could even avoid using a complete query by providing a fragment and using cache.readFragment and cache.writeFragment.
That's preference based. You can't use cache.link in this case (which is often the shortest way to update relations) because you likely have to write the edge to the cache as well however.

But the simplest update is to only update the list field, the edge, and only select keyable fields on your fragment.

What to do with the pageInfo data? should I update it manually? Because I believe without the correct pageInfo …

Replies: 1 comment 3 replies

Comment options

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

Answer selected by velidan
@velidan
Comment options

@velidan
Comment options

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