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

Add support for parsing and validating a query without executing it #726

Open
ccbrown opened this issue Jul 29, 2020 · 2 comments
Open

Add support for parsing and validating a query without executing it #726

ccbrown opened this issue Jul 29, 2020 · 2 comments
Labels
enhancement Improvement of existing features or bugfix good-first-issue help wanted

Comments

@ccbrown
Copy link
Contributor

ccbrown commented Jul 29, 2020

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:

// TODO: This could be made more efficient if juniper exposed functionality to allow us to
// parse and validate the query, determine whether it's a subscription, and then execute
// it. For now, the query gets parsed and validated twice.

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.

@ccbrown ccbrown added the enhancement Improvement of existing features or bugfix label Jul 29, 2020
@LegNeato
Copy link
Member

This would probably get rid of duplicate code between execute and execute_sync too.

@zacck-zz
Copy link

zacck-zz commented Sep 25, 2020

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix good-first-issue help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants