mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-25 23:39:49 +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
|
@classmethod
|
||||||
@memoize
|
@memoize
|
||||||
def for_node(cls, node, edge_type=None):
|
def for_node(cls, node, edge_type=None):
|
||||||
from graphene.relay.utils import is_node
|
from graphene.relay.utils import is_node, is_node_type
|
||||||
assert is_node(node), 'ObjectTypes in a connection have to be Nodes'
|
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.')
|
edges = List(node, description='Information to aid in pagination.')
|
||||||
return type(
|
return type(
|
||||||
'%s%s' % (node._meta.type_name, cls._meta.type_name),
|
'%s%s' % (node._meta.type_name, cls._meta.type_name),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user