You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.
What feature are you missing?
I am trying to configure caching on my Apollo API Gateway. For this, I need to add @cacheControl directives to my Types and fields. When I try to do that, the server doesn't throw any error, but the directives are silently removed. Unfortunately, mergeSchemas does not allow redefining fields, so it would be helpful if I could add them on the Graphcool side.
Also, the top-level queries that are generated are not accessible from the schema. It would be nice to be able to define cacheControl attributes for the generated query fields as well somehow.
Apollo Cache Control is an open standard, that will not only be implemented by Apollo Server, but also Sangria, etc. (according to their docs), so this is not a 'vendor-specific' thing.
How could this feature look like in detail? Tradeoffs?
Do not remove additional directives.
Proposal for generated query fields is to take the cacheControl attribute off the Type, so if I define:
type Post @model @cacheControl(maxAge: 30) {
...
}
Then the generated queries would also get that setting:
type Query {
allPosts(...) @cacheControl(maxAge: 30)
Post (...) @cacheControl(maxAge: 30)
}
Depends on:
Expose user-defined directives in API schema #1228
The text was updated successfully, but these errors were encountered:
Comment by kbrandwijk Saturday Oct 28, 2017 at 13:23 GMT
I have a working example here: https://github.com/kbrandwijk/graphcool-gateway-apollo-engine-demo#caching-example. The reason behind this issue is that adding directives to an existing field in a Gateway is difficult (see: ardatan/graphql-tools#451).
This is not necessarily just about cacheControl, but potentially about any directive not recognized by Graphcool, but useful 'downstream', like the new stream directive, or any other for that matter.
Issue by kbrandwijk
Wednesday Oct 25, 2017 at 17:56 GMT
Originally opened as https://github.com/graphcool/prisma/issues/1032
What feature are you missing?
I am trying to configure caching on my Apollo API Gateway. For this, I need to add
@cacheControl
directives to my Types and fields. When I try to do that, the server doesn't throw any error, but the directives are silently removed. Unfortunately,mergeSchemas
does not allow redefining fields, so it would be helpful if I could add them on the Graphcool side.Also, the top-level queries that are generated are not accessible from the schema. It would be nice to be able to define cacheControl attributes for the generated query fields as well somehow.
Apollo Cache Control is an open standard, that will not only be implemented by Apollo Server, but also Sangria, etc. (according to their docs), so this is not a 'vendor-specific' thing.
How could this feature look like in detail? Tradeoffs?
Then the generated queries would also get that setting:
Depends on:
The text was updated successfully, but these errors were encountered: