Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

# COVID19-Graphql
By sharadcodes

GOTO: 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 DATA

Use `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/ |