@@ -52,15 +52,6 @@ def value_from_ast(
5252 # Importantly, this is different from returning the value null.
5353 return Undefined
5454
55- if is_non_null_type (type_ ):
56- if isinstance (value_node , NullValueNode ):
57- return Undefined
58- type_ = cast (GraphQLNonNull , type_ )
59- return value_from_ast (value_node , type_ .of_type , variables )
60-
61- if isinstance (value_node , NullValueNode ):
62- return None # This is explicitly returning the value None.
63-
6455 if isinstance (value_node , VariableNode ):
6556 variable_name = value_node .name .value
6657 if not variables :
@@ -75,6 +66,15 @@ def value_from_ast(
7566 # is of the correct type.
7667 return variable_value
7768
69+ if is_non_null_type (type_ ):
70+ if isinstance (value_node , NullValueNode ):
71+ return Undefined
72+ type_ = cast (GraphQLNonNull , type_ )
73+ return value_from_ast (value_node , type_ .of_type , variables )
74+
75+ if isinstance (value_node , NullValueNode ):
76+ return None # This is explicitly returning the value None.
77+
7878 if is_list_type (type_ ):
7979 type_ = cast (GraphQLList , type_ )
8080 item_type = type_ .of_type
0 commit comments