I need to understand how to avoid duplicating items in List. I have mutation called createMessage with optimistic result and update function. In ApolloClient, normally optimistic response should be replaced with actual data, but i got item pushing twice, first optimisticResult then actual message.
This is a nice think to drive in, I currently do no have much time to look at the code, but I guess the code that implements the OptimisticResult will help you
I need to understand how to avoid duplicating items in List. I have mutation called createMessage with optimistic result and update function. In ApolloClient, normally optimistic response should be replaced with actual data, but i got item pushing twice, first optimisticResult then actual message.
Here's my code:
dependencies: graphql_flutter: ^5.1.2 flutter_hooks: ^0.18.6 graphql_codegen: ^0.12.2 build_runner: ^2.3.3