-
Notifications
You must be signed in to change notification settings - Fork 427
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
Add parse and validate functions #773
Add parse and validate functions #773
Conversation
Split out parse and validate and then re-use them in all execute functions.
Glad to see someone taking this on! At a high level, I have a few thoughts here, aimed mainly towards simplifying the API:
|
@ccbrown Thank you for looking into this!
|
This is a lower-level API that only people who know what they're doing should be using to begin with, so I think the hand-holding is unnecessary, but if we do think a type like |
Btw, these changes don't actually have to be in the |
I agree with these comments :-) |
Okay, thanks! That makes sense to me. I'll close this and create new PRs for the 3 new public APIs. I spent my evening yesterday investigating the
Let me know what you think. |
…ing and execution into two stages Based on graphql-rust#773 (comment) and graphql-rust#773 (comment)
…and execution (#874) * Make the executor and validation APIs public to enable splitting parsing and execution into two stages Based on #773 (comment) and #773 (comment) * Fix fmt warning for visit_all_rules * Add `Definition` to the public API so it's available for the result of compilation * Make OperationType public so that user land code can tell the difference between query/mutation and subscription * Add integrations tests for execute_validated_query_async, visit_all_rules, get_operation, and resolve_validated_subscription Co-authored-by: Christian Legnitto <[email protected]>
Fix: #726
Split out parse and validate and then re-use them in all execute functions.
This is a draft, please let me know if this direction is acceptable. Also, the current approach does not actually work in case of
execute
andresolve_into_stream
because of lifetime issues.I would be very happy to get some guidance on this, if this approach works, I'll add: