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
16ae9de16b
commit
6553d4554b
|
@ -113,13 +113,12 @@ class SimpleConnection(Connection):
|
|||
@memoize
|
||||
def for_node(cls, node, edge_type=None):
|
||||
from graphene.relay.utils import is_node
|
||||
edge_type = edge_type or node
|
||||
assert is_node(node), 'ObjectTypes in a connection have to be Nodes'
|
||||
edges = List(edge_type, description='Information to aid in pagination.')
|
||||
edges = List(node, description='Information to aid in pagination.')
|
||||
return type(
|
||||
'%s%s' % (node._meta.type_name, cls._meta.type_name),
|
||||
(cls,),
|
||||
{'edge_type': edge_type, 'edges': edges})
|
||||
{'edge_type': node, 'edges': edges})
|
||||
|
||||
@classmethod
|
||||
def from_list(cls, iterable, args, context, info):
|
||||
|
|
Loading…
Reference in New Issue
Block a user