Add closedByPullRequestsReferences JSON field to issue view (#10941)

* [gh issue view] Expose `closedByPullRequestsReferences` JSON fields

* Incorporate GitHub Copilot review suggestions

* Incorporate review changes
This commit is contained in:
Azeem Sajid 2025-05-07 17:59:22 +05:00 committed by GitHub
parent 315876852a
commit ee281fd9ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 187 additions and 11 deletions

View file

@ -56,6 +56,25 @@ var issueCommentLast = shortenQuery(`
}
`)
var issueClosedByPullRequestsReferences = shortenQuery(`
closedByPullRequestsReferences(first: 100) {
nodes {
id,
number,
url,
repository {
id,
name,
owner {
id,
login
}
}
}
pageInfo{hasNextPage,endCursor}
}
`)
var prReviewRequests = shortenQuery(`
reviewRequests(first: 100) {
nodes {
@ -296,6 +315,7 @@ var sharedIssuePRFields = []string{
var issueOnlyFields = []string{
"isPinned",
"stateReason",
"closedByPullRequestsReferences",
}
var IssueFields = append(sharedIssuePRFields, issueOnlyFields...)
@ -388,6 +408,8 @@ func IssueGraphQL(fields []string) string {
q = append(q, StatusCheckRollupGraphQLWithCountByState())
case "closingIssuesReferences":
q = append(q, prClosingIssuesReferences)
case "closedByPullRequestsReferences":
q = append(q, issueClosedByPullRequestsReferences)
default:
q = append(q, field)
}