I'm completely stuck on an Apollo problem, for which I've opened a GitHub issue and had zero response on.
I'm calling an Apollo mutation, using optimisticResponse
. The way it's supposed to work, as I understand it, is that update()
gets called twice: first with the optimistic data, then again with the actual data coming in from the network.
But for some reason, my code is not working like this. I'm getting two update()
calls, both with the optimistic data.
Here's a repo that demonstrates this behavior: https://github.com/ffxsam/apollo-update-bug
- yarn && yarn dev
- Open in browser, open console
- Enter some text and hit enter
- Repeat above
- Notice the error in the console about duplicate keys. This is happening because the temporary ID "??" is not being replaced with the real UUID (optional) You can open Vue DevTools if available and inspect the data to see it's incorrect