Skip to content

Commit 7040ffa

Browse files
committed
apply explicit pagination
1 parent a00f2d2 commit 7040ffa

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

api/schema/usecase_schema.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,14 @@ def published_use_cases(
150150

151151
# Apply pagination
152152
if pagination is not strawberry.UNSET:
153-
queryset = strawberry_django.pagination.apply(pagination, queryset)
153+
# Get the offset and limit from pagination
154+
offset = getattr(pagination, "offset", 0) or 0
155+
limit = getattr(pagination, "limit", None)
156+
157+
if limit is not None:
158+
queryset = queryset[offset : offset + limit]
159+
elif offset > 0:
160+
queryset = queryset[offset:]
154161

155162
return TypeUseCase.from_django_list(queryset)
156163

0 commit comments

Comments
 (0)