Skip to content

Best way to handle Graphcache updates with Mutations and Subscriptions on lists #1544

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

You must be logged in to vote

so that it returns only todos that were not created by that person.

That's a really good safe guard and I'd implement that if you can either way.

But I'd also check whether the list that you're adding to already has an item with an identical ID. Since it doesn't matter what query you use (or fragment) you'd typically just make a one-off GraphQL query with the list and its keyable fields (e.g. id); the update of the list item will already be taken care of automatically. So therefore you'd just have to make sure you don't add any duplicates manually

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@vescogma
Comment options

@kitten
Comment options

Answer selected by vescogma
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