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
LegNeato
left a comment
There was a problem hiding this comment.
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
|
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
operationanddocumentand then in the second step I'm using the [now public]validation::validate_input_valuesandexecutor::execute_validated_query_asyncorresolve_validated_subscriptionas needed.Thoughts on these changes?