Skip to content

Adding iterable and length to SQLAlchemyConnectionField #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion graphene_sqlalchemy/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def connection_resolver(cls, resolver, connection, model, root, args, context, i
_len = iterable.count()
else:
_len = len(iterable)
return connection_from_list_slice(
connection = connection_from_list_slice(
iterable,
args,
slice_start=0,
Expand All @@ -38,6 +38,9 @@ def connection_resolver(cls, resolver, connection, model, root, args, context, i
pageinfo_type=PageInfo,
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.model)