17
17
collect_fields , default_resolve_fn , get_field_def ,
18
18
get_operation_root_type )
19
19
from .executors .sync import SyncExecutor
20
- from .experimental .executor import execute as experimental_execute
21
20
from .middleware import MiddlewareManager
22
21
23
22
logger = logging .getLogger (__name__ )
24
23
25
24
26
- use_experimental_executor = False
27
-
28
-
29
25
def execute (schema , document_ast , root_value = None , context_value = None ,
30
26
variable_values = None , operation_name = None , executor = None ,
31
27
return_promise = False , middleware = None ):
32
- if use_experimental_executor :
33
- return experimental_execute (
34
- schema , document_ast , root_value , context_value ,
35
- variable_values , operation_name , executor ,
36
- return_promise , middleware
37
- )
38
-
39
28
assert schema , 'Must provide schema'
40
29
assert isinstance (schema , GraphQLSchema ), (
41
30
'Schema must be an instance of GraphQLSchema. Also ensure that there are ' +
@@ -186,7 +175,7 @@ def resolve_field(exe_context, parent_type, source, field_asts):
186
175
)
187
176
188
177
executor = exe_context .executor
189
- result = resolve_or_error (resolve_fn_middleware , source , args , context , info , executor )
178
+ result = resolve_or_error (resolve_fn_middleware , source , info , args , executor )
190
179
191
180
return complete_value_catching_error (
192
181
exe_context ,
@@ -197,9 +186,9 @@ def resolve_field(exe_context, parent_type, source, field_asts):
197
186
)
198
187
199
188
200
- def resolve_or_error (resolve_fn , source , args , context , info , executor ):
189
+ def resolve_or_error (resolve_fn , source , info , args , executor ):
201
190
try :
202
- return executor .execute (resolve_fn , source , args , context , info )
191
+ return executor .execute (resolve_fn , source , info , ** args )
203
192
except Exception as e :
204
193
logger .exception ("An error occurred while resolving field {}.{}" .format (
205
194
info .parent_type .name , info .field_name
0 commit comments