mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-09 08:00:39 +03:00
Merge pull request #323 from Globegitter/patch-9
Improve `is_node` error message
This commit is contained in:
commit
5cce7deb34
|
@ -13,8 +13,8 @@ def is_node(objecttype):
|
||||||
Check if the given objecttype has Node as an interface
|
Check if the given objecttype has Node as an interface
|
||||||
'''
|
'''
|
||||||
assert issubclass(objecttype, ObjectType), (
|
assert issubclass(objecttype, ObjectType), (
|
||||||
'Only ObjectTypes can have a Node interface.'
|
'Only ObjectTypes can have a Node interface. Received %s'
|
||||||
)
|
) % objecttype
|
||||||
for i in objecttype._meta.interfaces:
|
for i in objecttype._meta.interfaces:
|
||||||
if issubclass(i, Node):
|
if issubclass(i, Node):
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user