-
Notifications
You must be signed in to change notification settings - Fork 41
Weird error when running mutations with invalid inputs #69
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hello @adamors, I'm getting the same error as well. |
@ahrbil not really, currently any code that calls the graphql complexity methods is wrapped in a |
This library does not implement query and input validation to not duplicate the functionality and increase execution costs. So the error messages can vary. One option would be to validate the query and input arguments using the functions from the |
Taking this back - any error is obscured by this cryptic error when using this library. In development it'd be nice to have the actual errors sent to the client. |
@ivome I don't understand your work-around - can you elaborate? |
Currently unused variables are ignored for the purposes of calculating complexity. However, because graphql-js's `getVariableValues` method returns either a map of coersed values, OR an array of errors, if directives are present in conjuection with unused variables then strange errors will be raised. In particular errors will state that directive variables were not present when they may well have been. This change adds fallback measures to ensure that complexity will stil be calculated if unused variables are present alonside directives. Fixes slicknode#69
Currently unused variables are ignored for the purposes of calculating complexity. However, because graphql-js's `getVariableValues` method returns either a map of coersed values, OR an array of errors, if directives are present in conjuection with unused variables then strange errors will be raised. In particular errors will state that directive variables were not present when they may well have been. This change adds fallback measures to ensure that complexity will stil be calculated if unused variables are present alonside directives. Fixes slicknode#69
This should be fixed by the changes from #78 |
Hey, I've encountered a bug when running mutations and providing an invalid input.
Given the following schema
if you run the mutation
with variables
the expected error message is:
However with GraphQL Complexity enabled, this turns into
Here's a repo reproducing the issue: https://github.com/adamors/graphql-complexity-bug
The text was updated successfully, but these errors were encountered: