Skip to content

Commit 27fb2da

Browse files
babakksCopilot
andauthored
fix: improve docs around IssueRepoInfo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9f5dfa8 commit 27fb2da

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

api/queries_repo.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,9 @@ func FetchRepository(client *Client, repo ghrepo.Interface, fields []string) (*R
314314
return InitRepoHostname(result.Repository, repo.RepoHost()), nil
315315
}
316316

317-
// IssueRepoInfo fetches only the repository fields needed for issue creation,
318-
// avoiding fields like defaultBranchRef that require additional token permissions.
317+
// IssueRepoInfo fetches only the repository fields needed for issue operations such as
318+
// issue creation and transfer, avoiding fields like defaultBranchRef that require additional
319+
// token permissions.
319320
func IssueRepoInfo(client *Client, repo ghrepo.Interface) (*Repository, error) {
320321
query := `
321322
query IssueRepositoryInfo($owner: String!, $name: String!) {
@@ -338,6 +339,8 @@ func IssueRepoInfo(client *Client, repo ghrepo.Interface) (*Repository, error) {
338339
if err := client.GraphQL(repo.RepoHost(), query, variables, &result); err != nil {
339340
return nil, err
340341
}
342+
// The GraphQL API should have returned an error in case of a missing repository, but this isn't
343+
// guaranteed to happen when an authentication token with insufficient permissions is being used.
341344
if result.Repository == nil {
342345
return nil, GraphQLError{
343346
GraphQLError: &ghAPI.GraphQLError{

0 commit comments

Comments
 (0)