I’m trying to retrieve all reviewers on a PR, I did look at PullRequest schema but couldn’t find a way to get reviewers. I’ve an example PR @ https://github.com/baswaraj-malage/browser-stack-test/pull/2 with 3 reviewers. Just one reviewer added a review comment on the PR and I could get only that reviewer info. as response with below query. How do I read all reviewers and their review state?
Query:
{
viewer() {
pullRequests(first: 100, states: OPEN) {
totalCount
edges {
node {
... on PullRequest {
repository {
nameWithOwner
}
number
url
reviews(last: 10) {
totalCount
nodes {
author {
login
}
}
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
Response:
{
“data”: {
“viewer”: {
“pullRequests”: {
“totalCount”: 1,
“edges”: [
{
“node”: {
“repository”: {
“nameWithOwner”: “baswaraj-malage/browser-stack-test”
},
“number”: 2,
“url”: “https://github.com/baswaraj-malage/browser-stack-test/pull/2”,
“reviews”: {
“totalCount”: 1,
“nodes”: [
{
“author”: {
“login”: “ravibm100”
}
}
]
}
}
}
],
“pageInfo”: {
“hasNextPage”: false,
“endCursor”: “Y3Vyc29yOnYyOpHOD7wvOQ==”
}
}
}
}
}