GraphQL resolved conversations

I’m trying to write a GraphQL query that will return to me the resolved / unresolved state of a pull request’s conversation.  For example, let’s say that a reviewer added three comments, and the original author resolves two of them.  How can I find out that there is 1 unresolved comment, and/or query for the list of resolved and unresolved comments?

I thought that the isMinimized flag might indicate the resolved state (since I also can’t exactly find out how a “minimized” comment maps the UI), but when I run the query, I see that both resolved and unresolved comments have a false value for this flag.

So the question is: how can I find the resolved state of a pull request review comment?

Aside, what is the minimized state of a comment?

(I should note also that I haven’t found an obvious surfacing of this information in the v3 REST API either, so that leads me to believe that this information is not available via the API.)

Thanks!

The PullRequestReviewThread contains this information.  The following query works as an example.  I believe in your case you’d have to iterate through the results looking for isResolved = false.

query {
  repository(owner:"github", name:"github") {
    pullRequests(last: 50){
      nodes {
        id,
        reviewThreads(last:50) {
          nodes{
            id,
            isResolved
          }
        }
      }
    }
  }
}
1 Like

Thanks, that’s exactly what I was looking for!