Get list of statuses for a commit

I am trying to retrieve with graphql the list of statuses for the last commit of the PRs of a repository. In the rest api I see that it is possible to get it: Repositories - GitHub Docs

So far I have the following code:

{
  repository(name: "QualityControl", owner: "AliceO2Group") {
    pullRequests(states: OPEN, first: 100) {
      edges {
        node {
          commits(last: 1) { # only the last one
            edges {
              node {
                commit {
                  checkSuites { # return null
                    totalCount
                    edges {
                      node {
                        status
                      }
                    }
                  }
                  status {
                    state # the combined state
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

I can get the combined state but I want the status of each check done on this commit. The checkSuites is returning null.

Any idea ?
Thank you

Hey @Barthelemy :wave:

You’ll want to define a first or last value for checkSuites like you have for pullRequests and commits.

So you can try:

{
  repository(name: "QualityControl", owner: "AliceO2Group") {
    pullRequests(states: OPEN, first: 100) {
      edges {
        node {
          commits(last: 1) { # only the last one
            edges {
              node {
                commit {
                  checkSuites(first: 100) {
                    totalCount
                    edges {
                      node {
                        status
                      }
                    }
                  }
                  status {
                    state # the combined state
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}