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

Query with default values will cause error: "Argument \"input\" has invalid value... #29

Open
robertu7 opened this issue Jul 2, 2019 · 3 comments

Comments

@robertu7
Copy link

robertu7 commented Jul 2, 2019

As title,

image

@robertu7 robertu7 changed the title Query with default variables will cause error: "Argument \"input\" has invalid value... Query with default values will cause error: "Argument \"input\" has invalid value... Jul 2, 2019
@ellispritchard
Copy link

ellispritchard commented Aug 19, 2019

I'm getting this error when I've got custom scalars, when the custom scalar validation rejects the input: the nicely informative message from my custom scalar is not shown, but the error from graphql/execution/values.js#getArgumentValues (as in the stack trace above) is shown instead.

Is the correct function being called here? The particular exception block being triggered is commented:

          // Note: ValuesOfCorrectType validation should catch this before
          // execution. This is a runtime check to ensure execution does not
          // continue with an invalid argument value.

Looks like getArgumentValues is being called out-of-order as far as the execution pipeline is concerned?

@ellispritchard
Copy link

NB the original error from validation is also reported in the result, so ValuesOfCorrectType is also being run, but this doesn't stop related errors also being generated from the cost evaluation.

@koresar
Copy link

koresar commented Jan 29, 2020

I get exactly the same problem as the screenshot. This literally means the GraphQL API users can't pass $input variable like at all!

I believe this line passes wrong variables.

this.options.variables || {}

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

No branches or pull requests

3 participants