Skip to content

🌎 Public GraphQL API for information about countries

License

Notifications You must be signed in to change notification settings

codeway-0841/countries

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

globe

Countries GraphQL API

Build Status Contributor Covenant Twitter Follow

A public GraphQL API for information about countries, continents, and languages. This project uses Countries List and provinces as data sources, so the schema follows the shape of that data, with a few exceptions:

  1. The codes used to key the objects in the original data are available as a code property on each item returned from the API.
  2. The country.continent and country.languages are now objects and arrays of objects, respectively.
  3. Each Country has an array of states populated by their states/provinces, if any.

Writing queries

{
  country(code: "BR") {
    name
    native
    capital
    emoji
    currency
    languages {
      code
      name
    }
  }
}

The above GraphQL query will produce the following JSON response:

{
  "data": {
    "country": {
      "name": "Brazil",
      "native": "Brasil",
      "capital": "Brasília",
      "emoji": "🇧🇷",
      "currency": "BRL",
      "languages": [
        {
          "code": "pt",
          "name": "Portuguese"
        }
      ]
    }
  }
}

Docs

Check out the playground to explore the schema and test out some queries.

Examples

License

MIT

About

🌎 Public GraphQL API for information about countries

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%