GitHub API GraphQL snippets

May 05, 2023 [Tech]

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
        }
      }
    }
}