Skip to content

Commit eeaf9ce

Browse files
committed
Fix check for custom reducer
1 parent 753b927 commit eeaf9ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/graphql/type/schema.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ def __init__(
115115
else:
116116
if not isinstance(types, AbstractSequence) or (
117117
# if reducer has been overridden, don't check types
118-
self.type_map_reducer.__self__.__class__ is GraphQLSchema
118+
getattr(self.type_map_reducer, "__func__", None)
119+
is GraphQLSchema.type_map_reducer
119120
and not all(is_named_type(type_) for type_ in types)
120121
):
121122
raise TypeError(
@@ -126,7 +127,8 @@ def __init__(
126127
# noinspection PyUnresolvedReferences
127128
if not isinstance(directives, AbstractSequence) or (
128129
# if reducer has been overridden, don't check directive types
129-
self.type_map_directive_reducer.__self__.__class__ is GraphQLSchema
130+
getattr(self.type_map_directive_reducer, "__func__", None)
131+
is GraphQLSchema.type_map_directive_reducer
130132
and not all(is_directive(directive) for directive in directives)
131133
):
132134
raise TypeError(

0 commit comments

Comments
 (0)