Skip to content

Commit 5785fc8

Browse files
committed
handle default values that could be None
1 parent ad91f0c commit 5785fc8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

graphql/utils/build_client_schema.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
__EnumValue, __Field, __InputValue, __Schema,
1313
__Type, __TypeKind)
1414
from .value_from_ast import value_from_ast
15+
from ..utils.undefined import UndefinedDefaultValue
1516

1617

1718
def _false(*_):
@@ -188,9 +189,10 @@ def build_field_def_map(type_introspection):
188189
])
189190

190191
def build_default_value(f):
191-
default_value = f.get('defaultValue')
192-
if default_value is None:
193-
return None
192+
try:
193+
default_value = f['defaultValue']
194+
except KeyError:
195+
return UndefinedDefaultValue
194196

195197
return value_from_ast(parse_value(default_value), get_input_type(f['type']))
196198

0 commit comments

Comments
 (0)