mirror of
https://github.com/FranP-code/countries.git
synced 2025-10-13 00:02:15 +00:00
imgbot
*Total -- 86.59kb -> 72.12kb (16.71%) /logo.png -- 15.76kb -> 10.85kb (31.14%) /examples/react/mr-worldwide.jpg -- 70.83kb -> 61.27kb (13.49%) Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
Countries GraphQL API
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:
- The codes used to key the objects in the original data are available as a
codeproperty on each item returned from the API. - The
country.continentandcountry.languagesare now objects and arrays of objects, respectively. - Each
Countryhas an array ofstatespopulated 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
- React
- React Native
- ReasonML
- Country quiz app (React, TypeScript)
- Python
- Seed
- Country Searcher
License
Languages
JavaScript
99.6%
Procfile
0.4%
