Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

List the id and names of the branches in the repository owned by someone else

I would like to list the id and names of the branches in the repository named “foo” owned by “johndoe” in https://docs.github.com/en/graphql/overview/explorer.

I am using https://docs.github.com/en/graphql/overview/explorer to make the query.

Any suggestion?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can run this query on https://docs.github.com/en/graphql/overview/explorer

edit: This will bring the first 10 of the branches! first or last is required to make the query.

{
  user(login:"johndoe"){
    repository(name:"foo") {
      refs(first: 10, refPrefix: "refs/heads/"){
        nodes {
          id,
          name}
      }
    }
  }
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading