-
Notifications
You must be signed in to change notification settings - Fork 2k
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
✨ Allowing extraCacheKeyData
to provide a cache key prefix
#6649
Conversation
|
✅ Deploy Preview for apollo-server-docs canceled.Built without sensitive environment variables
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 28d2462:
|
Hmm, this seems even more over-specific than #6428. Why not just let you completely override the I suppose one answer to my question is that this would make But I still don't see why hardcoding the concept of "dynamic prefix" into the API makes sense. Maybe some other cache system would work better with a dynamic suffix. So if we don't want to export (BTW I'd prefer Promise over ValueOrPromise; we removed ValueOrPromise from the main AS plugin API in AS3 and are removing it from this plugin's configuration in AS4.) |
Don't mind that solution either! The only thing we have to be ok with creating a lot more promises.
I think it's fine, it allows people to make their own cache keys. If they don't want to fall back on what is there today.
I'm game for that. I think making it not a promise would be a good idea though. If we allow for it to be a promise we're opening the gates to doing a lot of stuff that can cause problems. IE "let's query our DB to see what key to give this?!" |
Latest suggestion based on chat with @kschrade :
The assumption is that @kschrade and I don't see a particular use case for this to be async so for potential performance reasons let's keep this sync. However let's not make this replace extraCacheKeyData because we want to call that only once even if we end up constructing the key multiple times (once with session ID, once without). |
note btw that if we later decide to export |
closing for other pr |
I have tests as well in a local branch