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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable cache selectively per query #26

Open
kingzbauer opened this issue Nov 25, 2022 · 1 comment
Open

Enable cache selectively per query #26

kingzbauer opened this issue Nov 25, 2022 · 1 comment

Comments

@kingzbauer
Copy link

I am using gqlgen with ent. I want to test out the cache for only a select set of queries. One strategy to do this is to set the cache to skip by default for each incoming request but then be able to turn it on for specific GraphQL queries. The skip can be done at a middleware level. The only issue I am facing is that there is no public method to "toggle" ctxOptions.skip.

Would this qualify as a feature to add to the public interface?

@muvaf
Copy link

muvaf commented May 21, 2024

I'd love to see this. My use case is that I'd like to use the cache only for token lookups. I don't know much about how queries are generated but I think an option providing a list of tables during entcache initialization and the filtering by table name here could be a straight-forward solution. I can contribute the code if that sounds feasible to folks.

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

No branches or pull requests

2 participants