Coder Social home page Coder Social logo

sharadcodes / covid19-graphql Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 0.0 82 KB

COVID19 Graphql Server

Home Page: https://sharad-gql-covid19.herokuapp.com/graphql

License: MIT License

JavaScript 100.00%
covid-19 covid19 coronavirus covid-data covid-api graphql graphql-server graphql-api covid19-graphql covid19graphql

covid19-graphql's Introduction

COVID19-Graphql

By sharadcodes

GOTO: https://sharad-gql-covid19.herokuapp.com/graphql

HOW TO USE

Example using fetch

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.

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/

covid19-graphql's People

Contributors

dependabot[bot] avatar sharadcodes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

covid19-graphql's Issues

Sorting issue

Hello, how do you sort data? USA today has more cases than Cina but Cina is still on top.

Thanks!

Data inconsistency

Hello, I found inconsistent data for Italian numbers. I'm using your data here but as you can see there is an inconsistency with my new daily positive and yours. Do you know why? Where do you get Italian data?

Thanks for the amazing job!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.