-
Notifications
You must be signed in to change notification settings - Fork 429
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
Make the executor and validation APIs public to enable split parsing and execution #874
Conversation
…ing and execution into two stages Based on graphql-rust#773 (comment) and graphql-rust#773 (comment)
a50fe2d
to
f984237
Compare
To sum up my thoughts from the linked issues:
|
…nce between query/mutation and subscription
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry this took so long. Can you add an integration test that uses the API so we can be sure to not regress?
…ules, get_operation, and resolve_validated_subscription
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🍻
This is now on crates.io. Thank you again! |
Hey @jerel! 👋 I have a question regarding this PR. Say you want to implement persistent queries, so in the first step, you parse and validate the query and save it to DB (so it can be accessed later while skipping validations). My question is: how should the validated query be stored in DB? Do you store it as a string (meaning that you must call |
@mrtnzlml good question... I think I would experiment with storing the string versus a lightweight binary approach like bincode. I forget the nuances of this query API but it's possible that something like this would work and would save the effort of parsing the string tokens a second time. Example (untested):
|
Making these APIs public is based on my understanding of #773 (comment) and #773 (comment)
This PR is related to #776, #726, and enables features similar to #843 to be implemented in user land code. In my project I'm currently doing this (pseudo code) in the first step:
so I can make use of the
operation
anddocument
and then in the second step I'm using the [now public]validation::validate_input_values
andexecutor::execute_validated_query_async
orresolve_validated_subscription
as needed.Thoughts on these changes?