mirror of
https://github.com/FranP-code/countries.git
synced 2025-10-13 00:02:15 +00:00
Add table of contents and migration notesgi
This commit is contained in:
20
README.md
20
README.md
@@ -18,6 +18,12 @@ A public GraphQL API for information about countries, continents, and languages.
|
|||||||
2. The `country.continent` and `country.languages` are now objects and arrays of objects, respectively.
|
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.
|
3. Each `Country` has an array of `states` populated by their states/provinces, if any.
|
||||||
|
|
||||||
|
- [Writing queries](#writing-queries)
|
||||||
|
- [Migration notes (pre-March 2020)](#migration-notes-pre-march-2020)
|
||||||
|
- [Docs](#docs)
|
||||||
|
- [Examples](#examples)
|
||||||
|
- [License](#license)
|
||||||
|
|
||||||
## Writing queries
|
## Writing queries
|
||||||
|
|
||||||
```graphql
|
```graphql
|
||||||
@@ -56,6 +62,20 @@ The above GraphQL query will produce the following JSON response:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Migration notes (pre-March 2020)
|
||||||
|
|
||||||
|
In the first version of this API, `code` arguments were treated as `String`s. Now, they are enums of valid options only. To migrate, simply remove the double quotes from your existing code arguments:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
{
|
||||||
|
- country(code: "CA") {
|
||||||
|
+ country(code: CA) {
|
||||||
|
name
|
||||||
|
emoji
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Docs
|
## Docs
|
||||||
|
|
||||||
Check out [the playground](https://countries.trevorblades.com) to explore the schema and test out some queries.
|
Check out [the playground](https://countries.trevorblades.com) to explore the schema and test out some queries.
|
||||||
|
|||||||
Reference in New Issue
Block a user