Skip to content

graphqlbackend: Only sort branches if less than 1000

Administrator requested to merge core/interactive-refs into master

Created by: keegancsmith

To sort branches we need to fetch each branch's commit individually. This is a slow operation. So we introduce a new field to the GraphQL calls "interactive". It defaults to true, and will skip on the expensive operation if we have too many commits to get. 1000 is a thumb-sucked number.

Test plan: Visit a repository locally and confirm we still have sorted branches. Adjust 1000 down to 1 and see if branches still show up.

Fixes https://github.com/sourcegraph/sourcegraph/issues/4581

Merge request reports

Loading