Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

Apply condition to totalCount

Hi everyone!

 

I'm trying to query issues on multiple repositories based in an organization.

I have the following query

 

{
  organization(login: "angular") {
    name
    url
    avatarUrl
    repositories(first: 100) {
      totalCount
      edges {
        node {
          name
          url
          bugFixIssues: issues(first: 1, labels: ["type: bug/fix"], filterBy: {states: OPEN}) {
            totalCount
          }
        }
      }
    }
  }
}

But I want to get all repositories only when the totalCount on bugFixIssues is more than 0 (zero).

Is it possible?

 

Thanks!

1 Reply
Community Manager
Message 2 of 2

Re: Apply condition to totalCount

It sounds like what you're saying is that you want the list of repositories to only include repositories that return at least one issue result? If my understanding is correct, the GraphQL language doesn't offer that kind of filtering. All filtering or sorting has to be built in to the connections themselves like `filterBy: { states: OPEN }` in your query. Once the data is returned though, you can filter it on whatever criteria you wish.

 

I hope that helps!