mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-24 23:09:46 +03:00
Also allow node interface in SimpleConnection
This commit is contained in:
parent
226b27fc4e
commit
cfb0b2257b
|
@ -112,8 +112,8 @@ class SimpleConnection(Connection):
|
|||
@classmethod
|
||||
@memoize
|
||||
def for_node(cls, node, edge_type=None):
|
||||
from graphene.relay.utils import is_node
|
||||
assert is_node(node), 'ObjectTypes in a connection 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 connection have to be Nodes'
|
||||
edges = List(node, description='Information to aid in pagination.')
|
||||
return type(
|
||||
'%s%s' % (node._meta.type_name, cls._meta.type_name),
|
||||
|
|
Loading…
Reference in New Issue
Block a user