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

Don't read from cache when fetchPolicy = 'no-cache' #3396

Closed
gaberudy opened this issue May 3, 2018 · 1 comment
Closed

Don't read from cache when fetchPolicy = 'no-cache' #3396

gaberudy opened this issue May 3, 2018 · 1 comment
Assignees
Labels
📚 good-first-issue Issues that are suitable for first-time contributors. ✔ confirmed 🙏 help-wanted

Comments

@gaberudy
Copy link

gaberudy commented May 3, 2018

I have a lot of large read-only queries that I am using fetchPolicy='no-cache', but through the vue-apollo bindings the getCurrentQueryResult function is used in certain contexts that do a lot of unnecessary work / exceptions being thrown and caught that show up in my profiling analysis.

At this line, it should be safe to no execute this.dataStore.getCache().read(...) if observableQuery.options.fetchPolicy = 'no-cache' since our store will never contain this query.

Probably short-circuiting the function and returning: return maybeDeepFreeze({ data: {}, partial: true }); would be best.

const data = this.dataStore.getCache().read({

@hwillson
Copy link
Member

hwillson commented Jul 27, 2018

To help provide a more clear separation between feature requests / discussions and bugs, and to help clean up the feature request / discussion backlog, Apollo Client feature requests / discussions are now being managed under the https://github.com/apollographql/apollo-feature-requests repository.

Migrated to: apollographql/apollo-feature-requests#32

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📚 good-first-issue Issues that are suitable for first-time contributors. ✔ confirmed 🙏 help-wanted
Projects
None yet
Development

No branches or pull requests

2 participants