Skip to content

Commit 7fe0d47

Browse files
committed
Partly fix "sketchy-null-bool" issue
Replicates graphql/graphql-js@b1a39de
1 parent 03cd524 commit 7fe0d47

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

graphql/validation/rules/variables_in_allowed_position.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ def allowed_variable_usage(
7676
it is located.
7777
"""
7878
if is_non_null_type(location_type) and not is_non_null_type(var_type):
79-
has_non_null_variable_default_value = var_default_value and not isinstance(
80-
var_default_value, NullValueNode
79+
has_non_null_variable_default_value = (
80+
var_default_value is not None
81+
and not isinstance(var_default_value, NullValueNode)
8182
)
8283
has_location_default_value = location_default_value is not INVALID
8384
if not has_non_null_variable_default_value and not has_location_default_value:

0 commit comments

Comments
 (0)