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 DefinitelyTyped for http-cache-semantics, let you pass options to it #112

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

glasser
Copy link
Member

@glasser glasser commented Dec 6, 2022

Review individual commits.

…lyTyped

We sneakily add a few fields back in, and we add a check for a potential
issue that our types masked before.
Fixes #53. This is based on
apollographql/apollo-server#4306 by @harleynuss.

While it's generally not great to base our API on another package's API,
`http-cache-semantics` has been pretty stable, and if it makes major
changes we can always major-bump this package.

Because a type from `http-cache-semantics` is now part of our API, this
makes its DefinitelyTyped package a non-dev dependency. While we're
there, I noticed that `@apollo/utils.keyvaluecache` had a strict
dependency which I changed to a caret.

I originally wanted to make `httpCacheSemanticsCachePolicyOptions` part
of `CacheOptions` (next to `ttl`) but that function gets called *after*
the request is made (with the response as an argument), which is too
late.
@glasser
Copy link
Member Author

glasser commented Dec 6, 2022

I might do #65 as part of the same PR in a third commit.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Dec 6, 2022

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.

Copy link
Member

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache semantics options lgtm. Just re-request if you choose to do #65 as well and I can take another pass.

@glasser
Copy link
Member Author

glasser commented Dec 7, 2022

Eh I can merge and do it separately.

@glasser glasser merged commit a3db089 into main Dec 7, 2022
@glasser glasser deleted the glasser/cache-semantics-options branch December 7, 2022 21:40
glasser added a commit that referenced this pull request Dec 8, 2022
Also add a changeset for #112 that was merged today.

Fixes #65.
glasser added a commit that referenced this pull request Dec 8, 2022
Also add a changeset for #112 that was merged today.

Fixes #65.

Co-authored-by: Trevor Scheer <trevor.scheer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants