This chapter introduces you to querying GraphQL APIs through a few popular APIs.
Task: Find who are the top GitHub contributors in Wunderdog? The solution should involve a list of members in Wunderdog organisation, with the number of total contributions they have.
Your task:
- Generate personal Bearer token in GitHub (add grant read access, also to user organisations)
- Explore GitHub GraphQL API, both through docs in the web, GraphQL schema introspection and autocompletion.
- Write an actual query
Sample: What are the GitHub projects of Wunderdog?
query {
organization(login: "wunderdogsw") {
name
repositories(first: 100) {
nodes {
name
description
url
}
}
}
}
Solution
query {
organization(login: "wunderdogsw") {
name
repositories(first: 100) {
nodes {
name
description
url
}
}
}
}