Skip to content

does optimistic result merge with real results if real results is partial and some q #1793

Answered by JoviDeCroock
zhihengGet asked this question in Q&A
Discussion options

You must be logged in to vote

Updates happen automatically when the entity in question is in the cache this because we can see __typeName:id as an identification and update the fields returned in the mutation response. Addition is the only case where you need to worry about inspectfields and deletion can be done with invalidate.

An optimistic result should return the selectionSet your mutation is expecting this means that if your mutation expects id text and __typename that you should return those. The optimistic result is a 'fake server response' and will use the logic in your updaters to layer itself on top of the existing data. So everything untouched by the (optimistic) mutation will have the same data.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JoviDeCroock
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