Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for a human-readable string whenever passing a maxAge via schema hint or dynamic hints in code #7911

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

Open
andrewmcgivery wants to merge 5 commits into apollographql:main
base: main
Choose a base branch
Loading
from andrewmcgivery:feature/humanreadablecachehints

Conversation

Copy link
Contributor

@andrewmcgivery andrewmcgivery commented Aug 6, 2024

Add support for a human-readable string whenever passing a maxAge via schema hint or dynamic hints in code.

Addresses #7555.

Copy link

netlify bot commented Aug 6, 2024
edited
Loading

👷 Deploy request for apollo-server-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit af4dd27

Copy link

codesandbox-ci bot commented Aug 6, 2024
edited
Loading

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.

@andrewmcgivery andrewmcgivery marked this pull request as ready for review August 6, 2024 16:25
@andrewmcgivery andrewmcgivery marked this pull request as draft August 6, 2024 16:31
@andrewmcgivery andrewmcgivery marked this pull request as ready for review August 6, 2024 18:08
Copy link
Member

glasser commented Aug 14, 2024

On an abstract level, we originally envisioned @cacheControl as a relatively generic spec rather than something incredibly specific to the implementation in Apollo Server, and so the idea that the permitted values for the argument in the directive in the schema would depend on the implementation of a particular JS-specific third-party package without a formal specification is somewhat uncompelling. eg, it would be challenging to port such a feature to another ecosystem (say, to implement a compatible feature in Rust for Apollo Router) without having to carefully reproduce the semantics of the ms package.

In practice I don't know if these abstract arguments about a subsystem that has not been incredibly actively developed recently should be considered to be more important than more pragmatic approaches, though.

(We chose to have max age mean seconds without a particular unit in the title to match the HTTP cache-control: max-age=123 header, though I think we probably should have put a unit on it anyway.)

Copy link
Contributor Author

@glasser This PR is definitely not a hill I will die on. 😄 This is more of a "convenient DX" more than anything since all it really does is convert it to seconds, which could be done with a calculator anyways. 😅

Happy to close the PR if you are feeling this doesn't add enough value to outweigh the tradeoffs. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@glasser glasser Awaiting requested review from glasser glasser is a code owner

@trevor-scheer trevor-scheer Awaiting requested review from trevor-scheer

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /