List all repositories whose "__typename" = "Organization"

schema-request

#1

Is there a way to list all repositories whose “__typename” = “Organization”?

I’m looking for something like this:

{
  organizations(first: 10) {
    repositories(first: 2) {
      nodes {
        name
      }
    }
  }
}

The output would look something like this:

"repositories": {
  "nodes": [
    {
      "name": "react-ui"
    },
    {
      "name": "angular-ui"
    }
  ]
}

We are Enterprise users, if that’s relevant.

BTW great tooling, thanks!


List repositories filtered by owner and repo name
#2

Hi @elgalu!

Nothing like that exists right now, but I can see how that would be valuable in an Enterprise environment. I’ve added this to our internal issue tracker.

In the mean time, if you know the names of all of your organizations, something like this could work:

query {
  facebook: organization(login:"facebook") {
    ...OrganizationFields
  }
  
  angular: organization(login:"angular") {
    ...OrganizationFields
  }
}

fragment OrganizationFields on Organization {
  repositories(last:100) {
    nodes {
      name
    }
  }
}

But that is definitely not ideal because you’d have to alias each of the organization fields to avoid a conflict.


List repositories filtered by owner and repo name