mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-02 20:54:16 +03:00
Add documentation to is_node
This commit is contained in:
parent
3787269812
commit
100e03ec0c
|
@ -9,6 +9,12 @@ from ..types.interface import InterfaceMeta
|
||||||
|
|
||||||
|
|
||||||
def is_node(objecttype):
|
def is_node(objecttype):
|
||||||
|
'''
|
||||||
|
Check if the given objecttype has Node as an interface
|
||||||
|
'''
|
||||||
|
assert issubclass(objecttype, ObjectType), (
|
||||||
|
'Only ObjectTypes can have a Node interface.'
|
||||||
|
)
|
||||||
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