From 27fb2da1c84d612066d0ce75c039fc5f59f19265 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Mon, 9 Mar 2026 12:16:02 +0000 Subject: [PATCH] fix: improve docs around IssueRepoInfo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- api/queries_repo.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/queries_repo.go b/api/queries_repo.go index bbf60a602..5bcf326e6 100644 --- a/api/queries_repo.go +++ b/api/queries_repo.go @@ -314,8 +314,9 @@ func FetchRepository(client *Client, repo ghrepo.Interface, fields []string) (*R return InitRepoHostname(result.Repository, repo.RepoHost()), nil } -// IssueRepoInfo fetches only the repository fields needed for issue creation, -// avoiding fields like defaultBranchRef that require additional token permissions. +// IssueRepoInfo fetches only the repository fields needed for issue operations such as +// issue creation and transfer, avoiding fields like defaultBranchRef that require additional +// token permissions. func IssueRepoInfo(client *Client, repo ghrepo.Interface) (*Repository, error) { query := ` query IssueRepositoryInfo($owner: String!, $name: String!) { @@ -338,6 +339,8 @@ func IssueRepoInfo(client *Client, repo ghrepo.Interface) (*Repository, error) { if err := client.GraphQL(repo.RepoHost(), query, variables, &result); err != nil { return nil, err } + // The GraphQL API should have returned an error in case of a missing repository, but this isn't + // guaranteed to happen when an authentication token with insufficient permissions is being used. if result.Repository == nil { return nil, GraphQLError{ GraphQLError: &ghAPI.GraphQLError{