Skip to content

Latest commit

 

History

History
60 lines (46 loc) · 1.28 KB

1_Simple_GraphQL_Queries.md

File metadata and controls

60 lines (46 loc) · 1.28 KB

Simple GraphQL Queries

This chapter introduces you to querying GraphQL APIs through a few popular APIs.

Basic Queries

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:

  1. Generate personal Bearer token in GitHub (add grant read access, also to user organisations)
  2. Explore GitHub GraphQL API, both through docs in the web, GraphQL schema introspection and autocompletion.
  3. 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
      }
    }
  }  
}

References

Navigation