Calling readFragment inside Type policies read
function causes it update every time fragment changes
#9306
Labels
🏓 awaiting-contributor-response
requires input from a contributor
💸 caching
⁉️ question
✍️ working-as-designed
Code sandbox link:
https://codesandbox.io/s/thirsty-paper-cx8f6?file=/src/App.js
I used the
readFragment
function inside type polices read function. Basically in my app, I need to use it to display data in a way I need. And a very interesting thing happened. When I update fragment using the updateFragment function, theread
function executes too and data in UI is updated too.And when I call the updateFragmentfunction with the same data but a different reference object it does not update and the read function does not execute.
So it is not clear if such behavior is considered to be always true or not?
I consider it as a bug because this behavior is not clearly described in the docs(at least by a few times reading it I did not find an explanation).
The text was updated successfully, but these errors were encountered: