Get top 10 organizations with the GraphQL API

Hi,

Is it possible to get top 10 organizations which have a number of members, with the GraphQL API?

I’d like to analyze like this: 

https://resources.whitesourcesoftware.com/blog-whitesource/git-much-the-top-10-companies-contributing-to-open-source

I was able to list 10 organizations by this query:

query {
  search(first: 10, type: USER, query: "type:org"){
    userCount
    edges{
      node{
        ... on Organization {
          name
          membersWithRole{
            totalCount
          }
        }
      }
    }
  }
}

But I cannot find the right queryString for sorting by  the number of members.

Regarding repositories, there is an undocumented scalar field: “stars”. By using this, we can compare repositories by the number of stars. Is there some similar undocumented scalar fields on the organizaition?

There isn’t a method to sort organizations by the number of members. You could iterate through all of them and sort them yourself though.

I hope that helps!