API to retrieve unresolved converstations in type/state CHANGES_REQUESTED for a PR.

Hi!

I’m pretty pretty new to graphQL here, trying to figure out if it’s possible to get a list of all the unresolved converstations in state CHANGES_REQUESTED for certain PR. I’m trying then implement a policy so that we can only merge PR when CHANGES_REQUESTED type of conversations are resolved (COMMENTED and APPROVED are netrual, we are ok leaving them unresolved).

What I have so far is that I can find a list of CHANGES_REQUESTED PullRequestReview and a list of unresolved PullRequestReviewThread:

{
  repository(name: "xx", owner: "xx") {
    pullRequest(number: 11) {
      reviewThreads(last: 50) {
        nodes {
          isResolved
          comments(last: 50) {
            nodes {
              id
            }
          }
        }
      }
      reviews(last: 50, states: CHANGES_REQUESTED) {
        __typename
        nodes {
          comments(last: 50) {
            nodes {
              id
            }
          }
          state
          body
        }
      }
    }
  }
}

But I’m not sure how to ‘join’ then.

Can anybody point me the direction or correct me if any of the above asumptions are wrong?