Replies: 1 comment
-
I don't understand your issue. You can specify that a field is uncacheable by adding a line to your schema or to resolvers, but you would like to place this in a third place? These are the mechanisms we provide. Why would a list of fields entirely separate from their declarations or code definitions work better? If you really want, you can write your own Apollo Server plugin which uses willResolveField to check if the field is in your list and calls |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I am using
ApolloServerPluginCacheControl
, fromapollo-server-core
, andresponseCachePlugin
, fromapollo-server-plugin-response-cache
, like so:This is working fine.
An annoyance I am facing though is that If I want to exclude an entire resolver, I have to add the following to every single resolver I want to exclude:
I am wondering, is there any way I can improve this and save myself having to add those lines to current and future resolvers that I do not want to be cached? To me it makes a lot more sense to exclude a resolver dynamically like this, rather than to do it statically in my schema.
Ideally I would like to some how pass an array of resolvers into
responseCachePlugin()
, or something similar, to be excluded. Is anything like this possible?Thanks
Beta Was this translation helpful? Give feedback.
All reactions