You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
When fetching the information about the commit that modified a file, we use an ancestors query that is filtered to the file name. This is a paginated interface, so we always request n+1 items so we know whether there is a next page.
However, the extra requested commit can actually be quite expensive to fetch, particularly in the relatively common case that a file has only been modified in one commit: the one that created it. In that case, we have to iterate over the entire history of the repository to look for a commit that doesn't exist to produce information about a next page that will never be fetched.
The ideal solution here would be to only fetch n+1 if the hasNextPage field of the resolver is requested. Unfortunately, our GraphQL package still doesn't support querying for which fields are requested, which is a huge bummer.
Instead, this takes a slightly hackier approach and assumes that if the number requested is 1, it's better to serve that quickly and claim we have a next page without knowing whether that page will contain anything.
0 commit comments