Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit 7751550

Browse files
committed
separated page_size from batch_size
1 parent a3180b1 commit 7751550

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

graphene_gae/ndb/fields.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ def connection_from_ndb_query(query, args={}, connection_type=None,
2626
after = full_args.get('after')
2727
has_previous_page = bool(after)
2828
keys_only = full_args.get('keys_only', False)
29-
batch_size = full_args.get('batch_size', 10)
29+
batch_size = full_args.get('batch_size', 20)
30+
page_size = first if first else full_args.get('page_size', 20)
3031
start_cursor = ndb.Cursor(urlsafe=after) if after else None
3132

3233
iter = query.iter(produce_cursors=True, start_cursor=start_cursor, batch_size=batch_size, keys_only=keys_only)
3334

34-
page_size = first if first else batch_size
3535
edges = []
3636
while len(edges) < page_size:
3737
try:
@@ -78,6 +78,7 @@ def __init__(self, type, **kwargs):
7878
type,
7979
keys_only=Boolean(),
8080
batch_size=Int(),
81+
page_size=Int(),
8182
**kwargs)
8283

8384
if not self.default:

0 commit comments

Comments
 (0)