envelop
envelop copied to clipboard
feat(response-cache): added getScope callback in buildResponseCacheKey
Issue related : https://github.com/n1ru4l/envelop/issues/2181
Description
Include a getScope
callback in buildResponseCacheKey
to enable an Apollo like behavior, where PUBLIC
scopes have only one cache key to get better performances on larger scales.
Type of change
- [x] New feature (non-breaking change which adds functionality)
- [x] This change requires a documentation update
How Has This Been Tested?
I added some unit tests to check that PRIVATE
scope is correctly retrieved from a query, when directive @cacheControl(scope: PRIVATE)
is put on query, field and subfield.
Checklist:
- [x] I have followed the CONTRIBUTING doc and the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented on my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
🦋 Changeset detected
Latest commit: 9e8ea70e3b71ce8265286fb4a450feb57f36e543
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
Name | Type |
---|---|
@envelop/response-cache | Minor |
@envelop/response-cache-cloudflare-kv | Major |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR