Allow specifying cacheControl attributes on Types and Fields #1032
Comments
Can you provide links to more resources about |
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 may be the wrong place, but has this been addressed? I could really use custom directives defined in my |
Since this discussion ended ~half a year ago, a lot has changed in the GraphQL ecosystem. Feel free to revisit this discussion in a new issue if you feel that this approach could be extended 🙂 |
@marktani I think it would be very helpful if directives would be 'preserved' across Prisma. When importing Prisma types into your schema, it's still hard to add directives to them. |
Yup, let's continue the discussion here: #1228 🙂 |
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: