Skip to content

Commit a3e36a5

Browse files
committed
Removed context from resolve_type
1 parent 0d8c20d commit a3e36a5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

graphql/execution/executor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ def complete_abstract_value(exe_context, return_type, field_asts, info, result):
324324
# Field type must be Object, Interface or Union and expect sub-selections.
325325
if isinstance(return_type, (GraphQLInterfaceType, GraphQLUnionType)):
326326
if return_type.resolve_type:
327-
runtime_type = return_type.resolve_type(result, exe_context.context_value, info)
327+
runtime_type = return_type.resolve_type(result, info)
328328
else:
329-
runtime_type = get_default_resolve_type_fn(result, exe_context.context_value, info, return_type)
329+
runtime_type = get_default_resolve_type_fn(result, info, return_type)
330330

331331
if isinstance(runtime_type, string_types):
332332
runtime_type = info.schema.get_type(runtime_type)
@@ -353,7 +353,7 @@ def complete_abstract_value(exe_context, return_type, field_asts, info, result):
353353
return complete_object_value(exe_context, runtime_type, field_asts, info, result)
354354

355355

356-
def get_default_resolve_type_fn(value, context, info, abstract_type):
356+
def get_default_resolve_type_fn(value, info, abstract_type):
357357
possible_types = info.schema.get_possible_types(abstract_type)
358358
for type in possible_types:
359359
if callable(type.is_type_of) and type.is_type_of(value, info):

graphql/execution/tests/test_abstract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, name):
2929

3030

3131
def make_type_resolver(types):
32-
def resolve_type(obj, context, info):
32+
def resolve_type(obj, info):
3333
if callable(types):
3434
t = types()
3535
else:

graphql/execution/tests/test_union_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def __init__(self, name, pets, friends):
5252
)
5353

5454

55-
def resolve_pet_type(value, context, info):
55+
def resolve_pet_type(value, info):
5656
if isinstance(value, Dog):
5757
return DogType
5858
if isinstance(value, Cat):
@@ -317,7 +317,7 @@ class encountered:
317317
root_value = None
318318
context = None
319319

320-
def resolve_type(obj, context, info):
320+
def resolve_type(obj, info):
321321
encountered.schema = info.schema
322322
encountered.root_value = info.root_value
323323
encountered.context = context

0 commit comments

Comments
 (0)