You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After investigating a pretty confusing performance problem in one of my apps, I came across a pretty serious issue.
As far as I can tell, every time any query or mutation occurs every single component that is watching any data in the apollo store gets re-rendered, even if none of its data has changed.
Imagine an e-commerce scenario: I favorite an item for later, which calls a mutation to save that favorited item on my account.
As a result, my entire page re-renders with hundreds of items since they're all being read from the apollo store, even though none of them have changed. This can take a few hundred milliseconds on a mobile device and cause stuttering and janking.
Intended outcome:
Each query's dependency graph is fully traversed and only updated if an object within that graph has changed.
Actual outcome:
Every single query is invalidated and re-run causing every component listening to any query in the store to re-render.
The text was updated successfully, but these errors were encountered:
Migrated from: apollographql/apollo-client#2895
Per @clayne11
The text was updated successfully, but these errors were encountered: