-
Notifications
You must be signed in to change notification settings - Fork 822
add support for query validation #1357
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
Conversation
@syrusakbary could you please review this if you have the time? It would be really helpful to use in production environments. Please let me know if any changes should be made, I'll do it! Thanks a lot! |
I'm liking this PR! Could it be possible if we fix CI as part of the PR? (replacing Travis with Github CI should be good!) |
@syrusakbary please check the new workflow I pushed in (also deleted the .travis.yml file). If any changes need to be done, please let me know! The also, I think that parallel processing isn't required, because we need to execute jobs sequentially (first tests, then check coverage and finally publish). What do you think about this? also, I created the workflow based on the .travis.yml file. I couldn't understand one thing and I am not sure about this. |
The PR looks great, although tests are not passing (it seems to be an issue on If you could help solving those last issues then we should be good to merge! |
Sure, I've managed to find out the problem. There have been a few changes in graphql core lately. The ExecutionContext class provided by graphql-core doesn't eat up exceptions now. You can check here for reference. Therefore, we could fix the failing tests by removing UnforgivingExecutionContext and related tests (we dont need it anymore) |
@AlecRosenbaum what do you think about this? |
If this was true, then the test suite should pass without specifying a custom context, right? |
Yep, could you please check my commits (changed files for this PR)? |
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.
@syrusakbary Does it really make sense to block this change on unrelated test failures?
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.
Looks great, merging!
@syrusakbary I think you forgot to set |
@syrusakbary should a new release be made to make this feature available? |
adds a few validation rules which would be very useful in production environments. Documentation regarding validators have been added, and new test cases have also been made (which pass).
Similar validation rules are provided out of the box in other libraries like strawberry graphql and ariadne, so it would be nice for graphene users to get a similar experience.
validation rules which have been added:
allows passing the validation rules to the
validate
method from graphql-core. Huge thanks to @jkimbo for his work on the depth limit validator, which was a port from https://github.com/stems/graphql-depth-limitalso fixes #907
also aims to fix CI, replacing travis CI with github actions