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

Offer Automatic persisted queries hash in the context #2589

Open
mostafa-rz opened this issue Jul 19, 2024 · 3 comments
Open

Offer Automatic persisted queries hash in the context #2589

mostafa-rz opened this issue Jul 19, 2024 · 3 comments
Labels
enhancement A feature or improvement

Comments

@mostafa-rz
Copy link
Contributor

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.

@spawnia
Copy link
Collaborator

spawnia commented Jul 19, 2024

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?

@spawnia spawnia added the enhancement A feature or improvement label Jul 19, 2024
@mostafa-rz
Copy link
Contributor Author

yes, if the config is true then it returns the hash otherwise it is null.

@spawnia
Copy link
Collaborator

spawnia commented Jul 19, 2024

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.

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

No branches or pull requests

2 participants