Skip to content

Commit 4413592

Browse files
committed
Improved Undefined object
1 parent f983e19 commit 4413592

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

graphql/execution/base.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
from ..utils.type_from_ast import type_from_ast
1010
from .values import get_argument_values, get_variable_values
1111

12-
Undefined = object()
12+
13+
class _Undefined(object):
14+
def __bool__(self):
15+
return False
16+
17+
__nonzero__ = __bool__
18+
19+
Undefined = _Undefined()
1320

1421

1522
class ExecutionContext(object):

0 commit comments

Comments
 (0)