-
-
Notifications
You must be signed in to change notification settings - Fork 674
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
info.cacheControl.cacheHint can only be set in globalMddleware, not resolver-based middleware. #199
Comments
There's no overwriting info object in resolvers unless you do it by yourself.
Cannot reproduce with Please create a repository with a minimal reproducible code example. |
@19majkel94 Here's the repository: index.ts
I use a dockerized apollo-engine instead of creating an instance in node.js because only the former is compatible with pm2 cluster mode. The apollo server must have detected the absence of an apollo-engine instance in js and refuse to add cacheControl to the response header. It used to add the header regardless of whether the apollo-engine was created in node.js. |
So basically it's not a fault on TypeGraphQL side - please open a proper issue in apollo server repository. When #77 is implemented, you would be able to declare the cache metadata using directives. |
In my project, |
@laukaichung do you have an example of this? |
Describe the bug
This CacheControl middleware from #75 no longer works when I use it in individual resolvers:
The only working way is to call
info.setCacheHint
in global middlewares, which is not very ideal :I guess the info object from global middlewares is overriding the one from the resolver-based middlewares?
Enviorment (please complete the following information):
The text was updated successfully, but these errors were encountered: