DEV Community

Sharad Raj (He/Him)
Sharad Raj (He/Him)

Posted on

GraphQL endpoint for getting stats of COVID19

I,ve created a GraphQL endpoint for getting stats of COVID19.
Use it and send a pull on REPO, I'll add it to the showcase.

Also I welcome all those who want to make it better. :)

LINK OF ENDPOINT: https://sharad-gql-covid19.herokuapp.com/graphql

Alt Text

Top comments (29)

Collapse
 
nickdesignsthings profile image
Nick Burczyk

I really want to use this API! I tried to use this in a codesandbox and got a "Network error: Failed to fetch" error. Do I need to so anything special to use this?

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him) • Edited

Did u tried again, it's not a normal API btw you'll have to use a lil different code perform the fetch on /graphql

Collapse
 
nickdesignsthings profile image
Nick Burczyk

Can you please include that different code in your readme/docs to help? I tried it in code sandbox, and now again locally with create-react-app with Apollo set up. Still no luck

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him) • Edited

Hang on I'm setting up the docs

Thread Thread
 
nickdesignsthings profile image
Nick Burczyk

:D

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him)

Done check it now

Thread Thread
 
nickdesignsthings profile image
Nick Burczyk

Awesome :) I got it working and am playing with building out the app. Will let you know when it is live!

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him)

AWESOME

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him) • Edited

Let me see and resolve the problem

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him)

It it fixed for you now ?

Collapse
 
nickdesignsthings profile image
Nick Burczyk

Thanks for posting this gql server! This is an interesting distraction in difficult times

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him)

Distraction ?

Collapse
 
cloudmunk profile image
CloudMunk

Dude this is awesome! Thank you! :)

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him) • Edited

Your welcome xD

Collapse
 
cloudmunk profile image
CloudMunk

Could you provide a coordinates(longitude, latitude) endpoint as well? :)

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him)

Yeah I'll do it by today night

Thread Thread
 
cloudmunk profile image
CloudMunk

You're a champ man! Thank you so much! :D

I'll leave you a link here once I am done building the app :)

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him)

Welcome :) ... Cool looking forward

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him)

I've added them have a look

Thread Thread
 
cloudmunk profile image
CloudMunk • Edited

I don't see them, what are they named?

Alt text of image

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him)

countryInfo

Collapse
 
bardaxx profile image
Giacomo Alonzi

Wow, can I use those data on my project? covidlive.it

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him)

Yeah sure

Collapse
 
bardaxx profile image
Giacomo Alonzi • Edited

Done! โœŒ๏ธ๐Ÿ˜ท covidlive.it/en

I found an inconsistency from your numbers and mine in Italy. Do you know why?

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him) • Edited

Cool submit a PR on repo...

and Why

Collapse
 
pebg profile image
pebg

Thanks !
You should also add yesterdayCases and yesterdayDeaths because most of the daily data are partial.

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him)

You're welcome...
Okay I'll add it by today night

Collapse
 
6igo profile image
Bensigo Egwey • Edited

Wonderful work.

Collapse
 
sharadcodes profile image
Sharad Raj (He/Him)

Thanks