mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-27 08:19:45 +03:00
Merge 9ff444aa1e
into d347ffaea0
This commit is contained in:
commit
691893e59b
|
@ -81,8 +81,11 @@ class Connection(ObjectType):
|
||||||
edge_type = edge_type or Edge.for_node(node)
|
edge_type = edge_type or Edge.for_node(node)
|
||||||
assert is_node(node), 'ObjectTypes in a connection have to be Nodes'
|
assert is_node(node), 'ObjectTypes in a connection have to be Nodes'
|
||||||
edges = List(edge_type, description='Information to aid in pagination.')
|
edges = List(edge_type, description='Information to aid in pagination.')
|
||||||
|
connection_name = (cls._meta.type_name
|
||||||
|
if node._meta.type_name.lower() in cls._meta.type_name.lower()
|
||||||
|
else '%s%s' % (node._meta.type_name, cls._meta.type_name))
|
||||||
return type(
|
return type(
|
||||||
'%s%s' % (node._meta.type_name, cls._meta.type_name),
|
connection_name,
|
||||||
(cls,),
|
(cls,),
|
||||||
{'edge_type': edge_type, 'edges': edges})
|
{'edge_type': edge_type, 'edges': edges})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user