GitHub API GraphQL snippets

Every time I try to use GitHib’s GraphQL API I find myself totally lost, so here are some snippets I have found useful.

All of these can be pasted into the GitHub GraphQL API Explorer, which can run the code as your logged-in user in the browser without the need to go through an authentication dance.

I will add more over time, and feel free to add any you like in the comments.

List all the projects in an organisation

query{
    organization(login: "matrix-org") {
      projectsV2(first: 20) {
        nodes {
          id
          title
        }
      }
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.