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

throw error, if getVariableValues fails #229

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/query-validation-visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ module.exports = class QueryValidationVisitor {
}

// Get variable values from variables that are passed from options, merged with default values defined in the operation
this.variableValues = getVariableValues(
const {coerced, errors} = getVariableValues(
this.context.getSchema(),
// We have to create a new array here because input argument is not readonly in graphql ~14.6.0
operation.variableDefinitions ? [...operation.variableDefinitions] : [],
this.options.variables ?? {}
).coerced
)
if (errors?.length > 0) throw errors
this.variableValues = coerced

// prepare basic this.currentTypeInfo based on the operation
let typeDef
Expand Down