How to list up all users in GitHub?

schema-request

#1

I’ve used REST API v3’s “GET /users” to list up all GitHub users’ "login"s. When migrating it to GraphQL API, I couldn’t do the same thing in Query’s fields (node, nodes, search, user). Is there any way to achieve it?


Issues based on labels
#2

Hi @k0kubun,

We don’t have a way of getting all users from the GraphQL API right now. I’ll add this as a schema request and will discuss with the team whether or not this feature will be coming forward to GraphQL. I’ll update you here when we have some more information.


#3

I’m also interested in this.


#4

Hi, I would like to have that feature too, specially on Github Enterprise

Cheers


#5

Maybe this can help :

{
  search(query: "type:user", first: 100, type: USER) {
    userCount
    pageInfo {
      endCursor
      hasNextPage
    }
    edges {
      node {
        ... on User {
          login
        }
      }
    }
  }
}

Try it in the explorer


#6

:wave: I wanted to share an update on this schema request.

Beginning in GitHub Enterprise 2.14, a users connection on Query (the root) will be added to the schema. For those not on GitHub Enterprise, I might suggest using @bertrandmartel’s suggestion.

Cheers,

Lizz