Skip to content

Commit 5385c83

Browse files
committed
Removed defer from graphql package
1 parent d8df44a commit 5385c83

File tree

5 files changed

+0
-857
lines changed

5 files changed

+0
-857
lines changed

graphql/execution/base.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
22
from ..error import GraphQLError
33
from ..language import ast
4-
from ..pyutils.defer import DeferredException
54
from ..type.definition import GraphQLInterfaceType, GraphQLUnionType
65
from ..type.directives import GraphQLIncludeDirective, GraphQLSkipDirective
76
from ..type.introspection import (SchemaMetaFieldDef, TypeMetaFieldDef,
@@ -85,12 +84,6 @@ class ExecutionResult(object):
8584

8685
def __init__(self, data=None, errors=None, invalid=False):
8786
self.data = data
88-
if errors:
89-
errors = [
90-
error.value if isinstance(error, DeferredException) else error
91-
for error in errors
92-
]
93-
9487
self.errors = errors
9588

9689
if invalid:

graphql/execution/tests/test_concurrent_executor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from graphql.type.definition import GraphQLNonNull
99

1010
from ..executors.thread import ThreadExecutor
11-
# from .utils import raise_callback_results
1211
from .utils import rejected, resolved
1312

1413

graphql/execution/tests/utils.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from graphql.pyutils.aplus import Promise
2-
from graphql.pyutils.defer import Deferred, DeferredException, _passthrough
32

43

54
def resolved(value):
@@ -8,44 +7,3 @@ def resolved(value):
87

98
def rejected(error):
109
return Promise.rejected(error)
11-
12-
13-
class RaisingDeferred(Deferred):
14-
15-
def _next(self):
16-
"""Process the next callback."""
17-
if self._running or self.paused:
18-
return
19-
20-
while self.callbacks:
21-
# Get the next callback pair
22-
next_pair = self.callbacks.pop(0)
23-
# Continue with the errback if the last result was an exception
24-
callback, args, kwargs = next_pair[isinstance(self.result,
25-
DeferredException)]
26-
27-
if callback is not _passthrough:
28-
self._running = True
29-
try:
30-
self.result = callback(self.result, *args, **kwargs)
31-
32-
except:
33-
self.result = DeferredException()
34-
35-
finally:
36-
self._running = False
37-
38-
if isinstance(self.result, Exception):
39-
self.result = DeferredException(self.result)
40-
41-
if isinstance(self.result, DeferredException):
42-
# Print the exception to stderr and stop if there aren't any
43-
# further errbacks to process
44-
self.result.raise_exception()
45-
46-
47-
def raise_callback_results(deferred, callback):
48-
d = RaisingDeferred()
49-
d.add_callback(lambda r: r)
50-
d.callback(deferred)
51-
d.add_callback(callback)

0 commit comments

Comments
 (0)