Offer Automatic persisted queries hash in the context
I want to add the APQ hash to the context, to be accessible in all the resolvers.
What problem does this feature proposal attempt to solve?
It is useable as a unique cache key for identical requests in custom cache key implementation.
Which possible solutions should be considered?
- The context interface should be updated to offer get/set of the new property
- Add the APQ hash to the context after the parse operation
If the feature is ok, I can send the PR.
How would this interact with the configuration lighthouse.query_cache? I presume the hash would only be available if lighthouse.query_cache.enable is true?
yes, if the config is true then it returns the hash otherwise it is null.
Alright, sounds good. I am not sure if the context interface can be extended without breaking changes, and how it interacts with features such as subscriptions - during which the context is serialized. Feel free to explore and contribute something, but perhaps think laterally.