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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new @cacheControl directive by Apollo, with Cache-Control header #968

Closed
wants to merge 3 commits into from

Conversation

jord1e
Copy link
Contributor

@jord1e jord1e commented Apr 9, 2022

Fixes #929

This was a pain in the back to be honest 馃槓. We needed the GraphQLContext object in the transport layers' class. This is mainly why the refactorings are so big.

Pull request checklist

  • Please read our contributor guide
  • Consider creating a discussion on the discussion forum
    first
  • Make sure the PR doesn't introduce backward compatibility issues
  • Make sure to have sufficient test cases

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Changes in this PR

Fixes #929

This has recently been implemented by federation-jvm (see: apollographql/federation-jvm#133)

A CacheControlInstrumentation instrumentation class must be injected, which adds the appropriate Cache-Control value into the GraphQLContext

I think the only breaking change is when people mock the execute method in DgsReactiveQueryExecutor or DgsQueryExecutor.

Alternatives considered

N/A, the header value must be set by the framework derived from the internal GraphQLContext

This has recently been implemented by federation-jvm (see: apollographql/federation-jvm#133)

A `CacheControlInstrumentation` instrumentation class must be injected, which adds the appropriate Cache-Control value into the GraphQLContext

Fixes Netflix#929
@berngp
Copy link
Contributor

berngp commented Apr 12, 2022

Thanks for the PR @jord1e , I'm rebasing to the latest changes and will review. Need some time thought to go through the changes.

@sijonelis
Copy link

Do we have an ETA on when this PR can be reviewed/merged?

@berngp
Copy link
Contributor

berngp commented Jun 16, 2022

Hi @Vilkazz , haven't been able to prioritize this review, since the feature is not used internally. I can't give you an ETA yet but will have it in mind as we plan work on DGS.

@sijonelis
Copy link

@berngp thanks for a quick answer, and sorry for being annoying with such pings!

@cmboult
Copy link

cmboult commented Jul 28, 2022

hi @berngp any update on ETA for this by any chance? we're really keen to start using this!

@marquies
Copy link

I vote for it too

# Conflicts:
#	graphql-dgs-reactive/src/main/java/com/netflix/graphql/dgs/reactive/DgsReactiveQueryExecutor.java
#	graphql-dgs-spring-webflux-autoconfigure/src/main/kotlin/com/netflix/graphql/dgs/webflux/autoconfiguration/DgsWebFluxAutoConfiguration.kt
#	graphql-dgs-spring-webflux-autoconfigure/src/main/kotlin/com/netflix/graphql/dgs/webflux/handlers/DefaultDgsWebfluxHttpHandler.kt
#	graphql-dgs-spring-webmvc-autoconfigure/src/main/kotlin/com/netflix/graphql/dgs/webmvc/autoconfigure/DgsWebMvcAutoConfiguration.kt
#	graphql-dgs-spring-webmvc/src/main/kotlin/com/netflix/graphql/dgs/mvc/DgsRestController.kt
#	graphql-dgs-spring-webmvc/src/test/kotlin/com/netflix/graphql/dgs/mvc/DgsMultipartPostControllerTest.kt
#	graphql-dgs/src/main/java/com/netflix/graphql/dgs/DgsQueryExecutor.java
#	graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/BaseDgsQueryExecutor.kt
@jord1e
Copy link
Contributor Author

jord1e commented Jul 28, 2022

That took me a little bit less then 3 hours because I used the wrong media type after the media type change some time ago (... and I merged into master instead of from master the first time 馃憥, this field is hard).

Ready for review again, all tests still passing

P.s. @berngp when are the hoodies coming 馃榿

Will also look into updating #923 , but thats a bit lower priority

@jord1e
Copy link
Contributor Author

jord1e commented Jul 28, 2022

Weird javadoc error, tests do pass

@heerak80
Copy link

Hi Team.. we have recently started using DGS for our subgraph.. do we have an ETA for this to be reviewed and merged ?

@srinivasankavitha
Copy link
Contributor

This has not been prioritized yet since we do not use this internally and the scope of files changed is large. Unfortunately, we don't have an ETA yet. If this changes, we will post an update.

@heerak80
Copy link

@srinivasankavitha -Thanks for the prompt response. Look forward to this being supported in future.

@SpeedyGonzaless
Copy link

Hi guys, I recently started to migrate to graphql using DGS and having this feature will be great. I hope it will be merged some time.

@setchy
Copy link
Contributor

setchy commented Apr 22, 2023

@srinivasankavitha is there interest in reviving this PR?

This enhancement is quite important to us and would love for it to be in the framework

@srinivasankavitha
Copy link
Contributor

Thanks for all the work @jord1e and for all the useful discussions around this feature. Unfortunately, we are not able to prioritize this effort at the moment due to other internal priorities. We will add this to our backlog of future work, and will post an update when we are able to look into this, hopefully in the near future.

Copy link

This pull request has been marked as stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale label Apr 27, 2024
@github-actions github-actions bot closed this May 5, 2024
@cicoub13
Copy link

cicoub13 commented May 5, 2024

Can we reopen this issue? The need is still present

@srinivasankavitha
Copy link
Contributor

Hi - we now have spring-graphql integration for the DGS framework. That would be a better project to request this feature since we can integrate that better into the framework.

@yamalameyooooo
Copy link

@srinivasankavitha is this feature is present in the spring-graphql integration for the DGS framework ?

@srinivasankavitha
Copy link
Contributor

No, I don't believe it is available there either. Feel free to open a discussion thread in the spring-graphql project as well so we can determine the best path forward for this feature. Now that we have the DGS framework integrated with spring-graphql, we should be able to easily pick up any new features available in spring-graphql.

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

Successfully merging this pull request may close these issues.

feature: support cacheControl static hints