Update types.py

This commit is contained in:
Markus Padourek 2016-06-07 17:57:06 +01:00
parent 87b48efbe1
commit 576c3b1092

View File

@ -49,8 +49,8 @@ class Edge(ObjectType):
@classmethod
@memoize
def for_node(cls, node):
from graphene.relay.utils import is_node
assert is_node(node), 'ObjectTypes in a edge have to be Nodes'
from graphene.relay.utils import is_node, is_node_type
assert is_node(node) or is_node_type(node), 'ObjectTypes in a edge have to be Nodes'
node_field = Field(node, description='The item at the end of the edge')
return type(
'%s%s' % (node._meta.type_name, cls._meta.type_name),