-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query returns objects with different identities even though data hasn't changed #4054
Comments
This is likely a combination of e66027c (which clones the I believe we should be able to remove the |
This commit is a more conservative version of e66027c We still need to make a deep clone of observableQuery.lastResult in order to determine if future results are different (see #3992), but we can restrict the use of that snapshot to a single method, rather than replacing observableQuery.lastResult with the snapshot. Should help with #4054.
Thanks! I think many React apps do shallow equality checks and this has affect on performance. Missing broadcasts is a problem but I can't think of a use case where app needs to get a broadcast when nothing changed (data, status or error). |
This commit is a more conservative version of e66027c We still need to make a deep clone of observableQuery.lastResult in order to determine if future results are different (see #3992), but we can restrict the use of that snapshot to a single method, rather than replacing observableQuery.lastResult with the snapshot. Should help with #4054.
This commit is a more conservative version of e66027c We still need to make a deep clone of observableQuery.lastResult in order to determine if future results are different (see #3992), but we can restrict the use of that snapshot to a single method, rather than replacing observableQuery.lastResult with the snapshot. Should help with #4054 and #4031.
This should be fixed by |
It works now. :) |
I have a query which returns array of objects. On the UI I'm skipping rendering if single object has same identity
oldObject === newObject
. Now ApolloClient seems to always return objects with different identities.Intended outcome:
Query returns objects with same identities because nothing changed.
Actual outcome:
Objects have different identities.
How to reproduce the issue:
Small repro where objects are compared to previous result: https://codesandbox.io/s/4w73lqw097
Versions
apollo-client: ^2.4.3 => 2.4.3
apollo-cache-inmemory: ^1.3.6 => 1.3.6
apollo-link-state: ^0.4.2 => 0.4.2
The text was updated successfully, but these errors were encountered: