Retrieve latest review by user on specific pull request #55863
Replies: 2 comments
-
query ($repoOwner: String = "cli", $repoName: String = "cli", $number: Int = 7259, $specificUser: String = "samcoe") {
repository(owner: $repoOwner, name: $repoName) {
pullRequest(number: $number) {
number
title
reviews(author: $specificUser, last: 1) {
totalCount
nodes {
authorAssociation
authorCanPushToRepository
author {
login
}
createdAt
}
}
}
}
} {
"data": {
"repository": {
"pullRequest": {
"number": 7259,
"title": "Edit multiple issues, PRs in parallel",
"reviews": {
"totalCount": 10,
"nodes": [
{
"authorAssociation": "MEMBER",
"authorCanPushToRepository": true,
"author": {
"login": "samcoe"
},
"createdAt": "2023-04-16T06:54:00Z"
}
]
}
}
}
}
} |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I would like to find the latest review made by a specific user on a specific pull request using the GitHub REST API.
GitHub API provides an endpoint for listing all the reviews of a pull request. However, the results are paginated and returned in chronological order, with the oldest review first. I can iterate through all the reviews, but I'm looking for a more efficient approach.
One potential solution I have considered is utilizing the link header provided in the API response:
I wonder if there is a better option I missed - filtering/ordering on the list reviews API or maybe a different API that can be useful.
Beta Was this translation helpful? Give feedback.
All reactions