Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit ade3c21

Browse files
committed
Avoid a COUNT resolving the Commit.uploads
Previously, the resolver would run a `count` just to know how many uploads there are, in order to return them all. Lets avoid that, and just use a really huge limit instead.
1 parent 382f278 commit ade3c21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graphql_api/types/commit/commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def resolve_list_uploads(commit: Commit, info: GraphQLResolveInfo, **kwargs):
108108
queryset = queryset.prefetch_related("errors")
109109

110110
if not kwargs: # temp to override kwargs -> return all current uploads
111-
kwargs["first"] = queryset.count()
111+
kwargs["first"] = 999_999
112112

113113
return queryset_to_connection_sync(
114114
queryset, ordering=("id",), ordering_direction=OrderingDirection.ASC, **kwargs

0 commit comments

Comments
 (0)