-
Notifications
You must be signed in to change notification settings - Fork 271
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
Variable types are not validated #62
Comments
I analyzed a bit and I would need to make quite some abstraction to make it all work. I think it would be best to wait for the higher level API @lrlna will be making on apollo-parser. @BrynCooke I was wondering if implementing the code to solve this issue is actually a good idea: this will slow down the router a little bit and since it's the variables it can't be entirely cached. The type validation itself is already done by the subgraphs. Why not just raise the errors and call it a day? |
Oh I see. The errors will match the sub queries variables, not the original variables which might differ. |
If it's simple I would be tempted to implement this:
What do you think though? It's throw away code for sure. @lrlna The timescales for the HIR will inform our decision on the above. Do you think it would be feasible to jump ahead and start contributing to an HIR in apollo-rs relatively soon? Otherwise there is probably still benefit from a stop-gap solution. |
@BrynCooke here is the current plan for semantic analysis that I think will be able to accommodate for other people to contribute to the work some time in the second part of January:
How does this sound to you? |
Thanks @lrlna, this sounds great. Given this information I am +1 to a stopgap on the router side with the intention of replacing with the apollo-rs HIR when it makes sense to do so. |
Closed by mistake |
# [v0.1.0-alpha.3] 2022-01-11 ## 🚀🌒 Public alpha release > An alpha or beta release is in volatile, active development. The release might not be feature-complete, and breaking API changes are possible between individual versions. ## ✨ Features - Trace sampling [#228](#228): Tracing each request can be expensive. The router now supports sampling, which allows us to only send a fraction of the received requests. - Health check [#54](#54) ## 🐛 Fixes - Schema parse errors [#136](#136): The router wouldn't display what went wrong when parsing an invalid Schema. It now displays exactly where a the parsing error occurred, and why. - Various tracing and telemetry fixes [#237](#237): The router wouldn't display what went wrong when parsing an invalid Schema. It now displays exactly where a the parsing error occurred, and why. - Query variables validation [#62](#62): Now that we have a schema parsing feature, we can validate the variables and their types against the schemas and queries.
Describe the bug
When passing in variables their types should be validated against the schema and the entire request rejected if they are incorrect.
Requires schema parsing to complete.
The text was updated successfully, but these errors were encountered: