From 100e03ec0c5f0588d044fa057b065ab0d068f886 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Tue, 16 Aug 2016 22:58:40 -0700 Subject: [PATCH] Add documentation to is_node --- graphene/relay/node.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/graphene/relay/node.py b/graphene/relay/node.py index 0f9fc49b..84011230 100644 --- a/graphene/relay/node.py +++ b/graphene/relay/node.py @@ -9,6 +9,12 @@ from ..types.interface import InterfaceMeta 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: if issubclass(i, Node): return True