mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-24 23:09:46 +03:00
Update types.py
This commit is contained in:
parent
87b48efbe1
commit
576c3b1092
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue
Block a user