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
Allow cache: "bounded"
or fail quickly if it is passed
#7240
Comments
glasser
added a commit
that referenced
this issue
Dec 10, 2022
- Explicitly allow people to pass `cache: 'bounded'`. Non-TS users upgrading from the recommended AS3.9+ configuration could do this by accident. Fixes #7240. - Upgrade `@apollo/utils.keyvaluecache` so that the new `PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation` feature lets you disable prefixing for the APQ and full response caches. Throw if you try to pass such a cache to `ApolloServer` itself because that cache is designed to be shared across features. Migrate off of PrefixingKeyValueCache for `documentStore` so that its prefixing can't be disabled. Fixes #6742.
This was referenced Dec 10, 2022
glasser
added a commit
that referenced
this issue
Dec 12, 2022
- Explicitly allow people to pass `cache: 'bounded'`. Non-TS users upgrading from the recommended AS3.9+ configuration could do this by accident. Fixes #7240. - Upgrade `@apollo/utils.keyvaluecache` so that the new `PrefixingKeyValueCache.cacheDangerouslyDoesNotNeedPrefixesForIsolation` feature lets you disable prefixing for the APQ and full response caches. Throw if you try to pass such a cache to `ApolloServer` itself because that cache is designed to be shared across features. Migrate off of PrefixingKeyValueCache for `documentStore` so that its prefixing can't be disabled. Fixes #6742.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue Description
In AS 3.9 we introduced
cache: "bounded"
as an easy way to shift to the newly-recommended-for-DOS-prevention behavior of not having an unbounded in-memory cache. In AS4 we made this behavior the default and stopped recognizingcache: "bounded"
. Non-TypeScript users upgrading to AS4 may miss the migration guide section stating that this is the default and in fact the migration guide does not state that the old value no longer works. While this is not a big deal for TS users (or@ts-check
users) and it would be unreasonable for us to try to reproduce our API's entire set of compile-time checks at runtime, this particular change penalizes users who followed our recommended practices in 3.9 on, so it would be nice to either explicitly allowcache: "bounded"
or to make it an immediate runtime failure (and update the migration guide).Link to Reproduction
caused problems here: apollographql/apollo-utils#236
Reproduction Steps
No response
The text was updated successfully, but these errors were encountered: