Added more info to the connections

This commit is contained in:
Syrus Akbary 2016-08-16 00:33:43 -07:00
parent a55741b03c
commit a056acba62
2 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,7 @@ class DjangoConnectionField(ConnectionField):
_len = iterable.count()
else:
_len = len(iterable)
return connection_from_list_slice(
connection = connection_from_list_slice(
iterable,
args,
slice_start=0,
@ -41,6 +41,9 @@ class DjangoConnectionField(ConnectionField):
connection_type=connection,
edge_type=connection.Edge,
)
connection.iterable = iterable
connection.length = _len
return connection
def get_resolver(self, parent_resolver):
return partial(self.connection_resolver, parent_resolver, self.type, self.get_manager())

View File

@ -131,6 +131,7 @@ class IterableConnectionField(Field):
edge_type=connection.Edge,
pageinfo_type=PageInfo
)
connection.iterable = iterable
return connection
def get_resolver(self, parent_resolver):