Get Array of repositoryOwner in GraphQL

I’m not super experienced in GraphQL, and I was not using it for a while, but I’ve recently wanted to give GitHub API another try. I was using my old Query to get most stared repos from the user (when I was testing this first time, stargazers was not yet implemented, or sorting bystargazers):

query {
  repositoryOwner(login: "jcubic") {
    repositories(first: 20, orderBy: {field: STARGAZERS, direction: DESC}, privacy: PUBLIC) {
      edges {
        repository:node {
          name
          stargazers {
            totalCount
          }
        }
      }
    }
  }
}

My question is: can I use the same query but return array of users? So I don’t need to query multiple times If I need to get stars from more then one user. If this is possible how this query should look like?

I’ve already asked on StackOverflow didn’t wait a while (only 3 hours) but wanted to ask here as well:

Get array of repositoryOwner from GitHub GraphQL

I have replied to you at: https://stackoverflow.com/questions/60510476/get-array-of-repositoryowner-from-github-graphql

1 Like

Just if someone need this here is the answer (if you can get id of the user then you can get them all in one query):

{
  nodes(ids: ["MDQ6VXNlcjI4MDI0MQ==", "MDQ6VXNlcjEwMjQwMjU="]) {
    ... on User {
      name
      login
    }
    ... on RepositoryOwner {
      repositories(first: 20, orderBy: {field: STARGAZERS, direction: DESC}, privacy: PUBLIC) {
        edges {
          repository: node {
            name
            stargazers {
              totalCount
            }
          }
        }
      }
    }
  }
}