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

Suppress extraneous error when ValuesOfCorrectType validation fails #33

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ellispritchard
Copy link

Because all validation rules are run, and all can report errors, and not just the first one that fails, and because costAnalysis depends on input arguments which may fail ValuesOfCorrectType validation, an extraneous error was being reported by costAnalysis, when it calls getArgumentValues, which may make it look like this is the part of the code with the problem, as this error may appear first in the errors property array of the query response, and that's all users may look at. (See #29 for an example of where this may have happened).

The error when calling getArgumentValues is a side-effect of failed validation elsewhere, and should not be reported from this validator.

This patch simply breaks out of the cost calculation for the contextual node when this occurs, which may, or may not subsequently report an over-cost error from the rest of the graph, but query execution will fail for the other validation reason anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant