@@ -43,7 +43,9 @@ def resolve_type(resolve_type_func, map, type_name, root, context, info):
43
43
44
44
if inspect .isclass (_type ) and issubclass (_type , ObjectType ):
45
45
graphql_type = map .get (_type ._meta .name )
46
- assert graphql_type and graphql_type .graphene_type == _type
46
+ assert graphql_type and graphql_type .graphene_type == _type , (
47
+ 'The type {} does not match with the associated graphene type {}.'
48
+ ).format (_type , graphql_type .graphene_type )
47
49
return graphql_type
48
50
49
51
return _type
@@ -71,7 +73,9 @@ def graphene_reducer(self, map, type):
71
73
if type ._meta .name in map :
72
74
_type = map [type ._meta .name ]
73
75
if isinstance (_type , GrapheneGraphQLType ):
74
- assert _type .graphene_type == type
76
+ assert _type .graphene_type == type , (
77
+ 'Found different types with the same name in the schema: {}, {}.'
78
+ ).format (_type .graphene_type , type )
75
79
return map
76
80
77
81
if issubclass (type , ObjectType ):
@@ -132,7 +136,9 @@ def construct_objecttype(self, map, type):
132
136
if type ._meta .name in map :
133
137
_type = map [type ._meta .name ]
134
138
if isinstance (_type , GrapheneGraphQLType ):
135
- assert _type .graphene_type == type
139
+ assert _type .graphene_type == type , (
140
+ 'Found different types with the same name in the schema: {}, {}.'
141
+ ).format (_type .graphene_type , type )
136
142
return _type
137
143
138
144
def interfaces ():
@@ -155,7 +161,9 @@ def construct_interface(self, map, type):
155
161
if type ._meta .name in map :
156
162
_type = map [type ._meta .name ]
157
163
if isinstance (_type , GrapheneInterfaceType ):
158
- assert _type .graphene_type == type
164
+ assert _type .graphene_type == type , (
165
+ 'Found different types with the same name in the schema: {}, {}.'
166
+ ).format (_type .graphene_type , type )
159
167
return _type
160
168
161
169
_resolve_type = None
0 commit comments