Skip to content

Commit 2cf4285

Browse files
committed
Use is_thenable instead of is_promise
1 parent 894c5ac commit 2cf4285

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

graphql/execution/executor.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
logger = logging.getLogger(__name__)
2323

2424

25-
def is_promise(obj):
26-
return type(obj) == Promise
27-
28-
2925
use_experimental_executor = False
3026

3127

@@ -141,7 +137,7 @@ def execute_fields(exe_context, parent_type, source_value, fields):
141137
continue
142138

143139
final_results[response_name] = result
144-
if is_promise(result):
140+
if is_thenable(result):
145141
contains_promise = True
146142

147143
if not contains_promise:
@@ -307,7 +303,7 @@ def complete_list_value(exe_context, return_type, field_asts, info, result):
307303
contains_promise = False
308304
for item in result:
309305
completed_item = complete_value_catching_error(exe_context, item_type, field_asts, info, item)
310-
if not contains_promise and is_promise(completed_item):
306+
if not contains_promise and is_thenable(completed_item):
311307
contains_promise = True
312308

313309
completed_results.append(completed_item)

0 commit comments

Comments
 (0)