Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sharadcodes/covid19-graphql
COVID19 Graphql Server
https://github.com/sharadcodes/covid19-graphql
coronavirus covid-19 covid-api covid-data covid19 covid19-graphql covid19graphql graphql graphql-api graphql-server
Last synced: 2 months ago
JSON representation
COVID19 Graphql Server
- Host: GitHub
- URL: https://github.com/sharadcodes/covid19-graphql
- Owner: sharadcodes
- License: mit
- Created: 2020-03-22T11:25:40.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-13T07:19:02.000Z (almost 2 years ago)
- Last Synced: 2024-05-01T17:57:56.047Z (9 months ago)
- Topics: coronavirus, covid-19, covid-api, covid-data, covid19, covid19-graphql, covid19graphql, graphql, graphql-api, graphql-server
- Language: JavaScript
- Homepage: https://sharad-gql-covid19.herokuapp.com/graphql
- Size: 80.1 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# COVID19-Graphql
By sharadcodesGOTO: https://sharad-gql-covid19.herokuapp.com/graphql
## HOW TO USE
**Example using fetch**
```js
fetch(
"https://sharad-gql-covid19.herokuapp.com/graphql",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
query: `{
countries {
country
countryInfo {
lat
long
}
cases
todayCases
deaths
todayDeaths
recovered
active
critical
casesPerOneMillion
deathsPerOneMillion
}
}
`
})
}
)
.then(res => res.json())
.then(res => console.log(res.data));
```
## FOR SORTING DATAUse `sortBy` followed by the key name and `order` folowed by either `desc` or `aesc`.
`sortBy` is `cases` by default & `order` is `desc` by default.
```js
fetch(
"https://sharad-gql-covid19.herokuapp.com/graphql",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
query: `{
countries(sortBy: "cases", order: "desc") {
country
countryInfo {
lat
long
}
cases
todayCases
deaths
todayDeaths
recovered
active
critical
casesPerOneMillion
deathsPerOneMillion
}
}
`
})
}
)
.then(res => res.json())
.then(res => console.log(res.data));
```## SHOWCASE
| Project | Github Repo | Live Demo |
| -------- | ---------- | --------- |
| COVIDLIVE | https://github.com/giacomoalonzi/covidlive.it | https://covidlive.it/ |