Can I add OptimisticResponse for different __typename than Mutation response returns?

Viewed 39

I use Apollo Client v3 and I have some data of type __typename: 'Entity' and this data has nested array under key relation of items of type __typename: 'Relation' and I also have mutation that updates that relations and it returns data back in response of type __typename: 'Relation'. It does not update on UI when data comes back after the mutation - I assume that my relations data I displayed on the UI is actually nested within another __typename and what I would like to achieve is when I run my mutation for update my relation data then my displayed list on UI will also be updated - let's say by Optimistic Response or something similar.

Is it achievable with that combination of Query and Mutation ?

Cheers!

0 Answers
Related