Skip to content

Commit 0d8c20d

Browse files
committed
Removed context from is_type_of
1 parent e5ec5da commit 0d8c20d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

graphql/execution/executor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,15 +356,15 @@ def complete_abstract_value(exe_context, return_type, field_asts, info, result):
356356
def get_default_resolve_type_fn(value, context, info, abstract_type):
357357
possible_types = info.schema.get_possible_types(abstract_type)
358358
for type in possible_types:
359-
if callable(type.is_type_of) and type.is_type_of(value, context, info):
359+
if callable(type.is_type_of) and type.is_type_of(value, info):
360360
return type
361361

362362

363363
def complete_object_value(exe_context, return_type, field_asts, info, result):
364364
"""
365365
Complete an Object value by evaluating all sub-selections.
366366
"""
367-
if return_type.is_type_of and not return_type.is_type_of(result, exe_context.context_value, info):
367+
if return_type.is_type_of and not return_type.is_type_of(result, info):
368368
raise GraphQLError(
369369
u'Expected value of type "{}" but got: {}.'.format(return_type, type(result).__name__),
370370
field_asts

graphql/execution/tests/test_abstract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, name):
2525
self.name = name
2626

2727

28-
is_type_of = lambda type: lambda obj, context, info: isinstance(obj, type)
28+
is_type_of = lambda type: lambda obj, info: isinstance(obj, type)
2929

3030

3131
def make_type_resolver(types):

graphql/execution/tests/test_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ def __init__(self, value):
472472
fields={
473473
'value': GraphQLField(GraphQLString),
474474
},
475-
is_type_of=lambda obj, context, info: isinstance(obj, Special)
475+
is_type_of=lambda obj, info: isinstance(obj, Special)
476476
)
477477

478478
schema = GraphQLSchema(

graphql/execution/tests/test_union_interface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __init__(self, name, pets, friends):
3838
'name': GraphQLField(GraphQLString),
3939
'barks': GraphQLField(GraphQLBoolean),
4040
},
41-
is_type_of=lambda value, context, info: isinstance(value, Dog)
41+
is_type_of=lambda value, info: isinstance(value, Dog)
4242
)
4343

4444
CatType = GraphQLObjectType(
@@ -48,7 +48,7 @@ def __init__(self, name, pets, friends):
4848
'name': GraphQLField(GraphQLString),
4949
'meows': GraphQLField(GraphQLBoolean),
5050
},
51-
is_type_of=lambda value, context, info: isinstance(value, Cat)
51+
is_type_of=lambda value, info: isinstance(value, Cat)
5252
)
5353

5454

@@ -70,7 +70,7 @@ def resolve_pet_type(value, context, info):
7070
'pets': GraphQLField(GraphQLList(PetType)),
7171
'friends': GraphQLField(GraphQLList(NamedType)),
7272
},
73-
is_type_of=lambda value, context, info: isinstance(value, Person)
73+
is_type_of=lambda value, info: isinstance(value, Person)
7474
)
7575

7676
schema = GraphQLSchema(query=PersonType, types=[PetType])

0 commit comments

Comments
 (0)