diff --git a/src/execution/values.js b/src/execution/values.js index ed01800375..35d27ac94d 100644 --- a/src/execution/values.js +++ b/src/execution/values.js @@ -146,11 +146,12 @@ export function getArgumentValues( let isNull; if (argumentNode && argumentNode.value.kind === Kind.VARIABLE) { const variableName = argumentNode.value.name.value; - hasValue = variableValues && hasOwnProperty(variableValues, variableName); - isNull = variableValues && variableValues[variableName] === null; + hasValue = + variableValues != null && hasOwnProperty(variableValues, variableName); + isNull = variableValues != null && variableValues[variableName] === null; } else { hasValue = argumentNode != null; - isNull = argumentNode && argumentNode.value.kind === Kind.NULL; + isNull = argumentNode != null && argumentNode.value.kind === Kind.NULL; } if (!hasValue && argDef.defaultValue !== undefined) { diff --git a/src/language/blockString.js b/src/language/blockString.js index 9012a90d34..42736483aa 100644 --- a/src/language/blockString.js +++ b/src/language/blockString.js @@ -80,7 +80,7 @@ function isBlank(str) { export function printBlockString( value: string, indentation?: string = '', - preferMultipleLines?: ?boolean = false, + preferMultipleLines?: boolean = false, ): string { const isSingleLine = value.indexOf('\n') === -1; const hasLeadingSpace = value[0] === ' ' || value[0] === '\t'; diff --git a/src/validation/rules/VariablesInAllowedPosition.js b/src/validation/rules/VariablesInAllowedPosition.js index 3631697c32..97cdd5374a 100644 --- a/src/validation/rules/VariablesInAllowedPosition.js +++ b/src/validation/rules/VariablesInAllowedPosition.js @@ -97,7 +97,7 @@ function allowedVariableUsage( ): boolean { if (isNonNullType(locationType) && !isNonNullType(varType)) { const hasNonNullVariableDefaultValue = - varDefaultValue && varDefaultValue.kind !== Kind.NULL; + varDefaultValue != null && varDefaultValue.kind !== Kind.NULL; const hasLocationDefaultValue = locationDefaultValue !== undefined; if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { return false;