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

Cache control directive improvement #2451

Merged
merged 20 commits into from
Sep 27, 2023

Conversation

mostafa-rz
Copy link
Contributor

@mostafa-rz mostafa-rz commented Sep 25, 2023

Bugfix and a new feature for the cache control directive:

  1. The paginator directive manipulates the AST and adds "data" field. In the cache control logic, this field identifies as an object without any cache TTL, therefore the max-age of the response is set to 0.
  2. Based on the Apollo it should be possible to set the cache control on the type-level.
  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Changes

  1. During the paginator AST manipulation, the cache control directive with inheritance is also set for the "data" field.
  2. Type-level cache control feature is implemented.

Breaking changes

Nothing

src/CacheControl/CacheControlServiceProvider.php Outdated Show resolved Hide resolved
src/Pagination/PaginationManipulator.php Outdated Show resolved Hide resolved
src/Pagination/PaginationManipulator.php Show resolved Hide resolved
@spawnia spawnia added the enhancement A feature or improvement label Sep 26, 2023
@spawnia
Copy link
Collaborator

spawnia commented Sep 27, 2023

@spawnia spawnia merged commit 094ce90 into nuwave:master Sep 27, 2023
21 of 22 checks passed
@mostafa-rz mostafa-rz deleted the cache-control-bug-fix branch September 27, 2023 09:11
@spawnia
Copy link
Collaborator

spawnia commented Sep 27, 2023

Thank you, released with https://github.com/nuwave/lighthouse/releases/tag/v6.20.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants