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

Use clientState cache if provided in apollo-boost #3439

Closed

Conversation

petetnt
Copy link
Contributor

@petetnt petetnt commented May 11, 2018

This PR fixes #3220 by using cache supplied to clientState config if passed instead of the default InMemoryCache.

(index.ts lines 62-80 were formatted by prettier and contain no new changes).

Signed-off-by: petetnt pete.a.nykanen@gmail.com

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

Signed-off-by: petetnt <pete.a.nykanen@gmail.com>
@hwillson
Copy link
Member

Thanks for submitting this PR @petetnt! Unfortunately, this isn't something we're ready to merge at this point. I've outlined the reasons why in #3220 (comment), but just to re-cap:

apollo-boost is intended to be an opinionated approach for working with Apollo Client. The fact that the default InMemoryCache instance can't be changed, is by design. Anyone who wants to use a different cache implementation is advised to setup an ApolloClient instance manually.

I've left that issue open for discussion though, so if there are compelling reasons why this should be a feature, we'll definitely re-consider a variation of this PR. Thanks again for your time and contribution!

@hwillson hwillson closed this May 23, 2018
@petetnt
Copy link
Contributor Author

petetnt commented May 23, 2018

Sent a message to the original issue.

@hwillson
Copy link
Member

This functionality has been added via #3561, but I just wanted to say thanks again for submitting this PR originally @petetnt. Your PR here (and your discussion in #3220) helped get this feature in.

@petetnt
Copy link
Contributor Author

petetnt commented Jun 13, 2018

Thanks!

@petetnt petetnt deleted the boost-allow-overwrite-cache branch June 13, 2018 10:58
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow custom cache to be passed as config option to ApolloClient exported from "apollo-boost"
2 participants