juniper
juniper copied to clipboard
Add support for parsing and validating a query without executing it
Currently there's no way to know if a request contains a subscription operation until you try to execute it. This is a problem for example in our graphql-ws implementation, which currently just has to invoke both juniper::execute
and juniper::resolve_into_stream
and see what works:
https://github.com/graphql-rust/juniper/blob/84c9720b535c37dfc1d8bc6b142bf2f63e5fd166/juniper_graphql_ws/src/lib.rs#L301-L303
It would be useful if juniper
had a lower level API that could be used to parse and validate a query, determine what type of operation is requested, then execute it.
This would probably get rid of duplicate code between execute
and execute_sync
too.
Hey @LegNeato I would love to take this on, but at the moment I have no idea where to get started, is it ok to ask for instructions on what needs to be done? Thank you so much!