Skip to content

Commit 7305fd7

Browse files
committed
fix(pagination): Ensure page number is always at least 1 in apply_common_pagination
1 parent ec3e4c8 commit 7305fd7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/api_server/graphql_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def apply_common_pagination(data, options):
4747
# --- PAGINATE ---
4848
if options.page is not None and options.limit is not None:
4949
effective_limit = min(options.limit, _MAX_LIMIT)
50-
start = (options.page - 1) * effective_limit
50+
page = max(1, options.page)
51+
start = (page - 1) * effective_limit
5152
end = start + effective_limit
5253
data = data[start:end]
5354

0 commit comments

Comments
 (0)