Skip to content
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

Add proper query invalidation #67

Closed
darren128 opened this issue Nov 6, 2018 · 1 comment
Closed

Add proper query invalidation #67

darren128 opened this issue Nov 6, 2018 · 1 comment

Comments

@darren128
Copy link

darren128 commented Nov 6, 2018

Migrated from: apollographql/apollo-client#2895

Per @clayne11

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.

@clayne11
Copy link

clayne11 commented Nov 6, 2018

This was resolved a few weeks ago in a PR from benjamn. This can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants