Skip to content

scottjr632/graph-covid-19

Repository files navigation

GraphQL Server for COVID-19 data

GraphQL Playground

This is a GraphQL server that consumes the NY Times data source and John Hopkins University (JHU CSSE) data source for covid-19 and serves it using GraphQL queries.

NYT
JHU CSSE

Using this project? let me know!

or if you found an issue or want a new dataset, create a new issue here

Getting Started

Visit https://graph-cv19.iscottrichardson.com/ to use the server
or
Pull Docker image

$ docker pull scottjr632/graph-covid-19

or
Create your own

$ git clone https://github.com/scottjr632/graph-covid-19.git && cd $_
$ yarn install
$ # development environment
$ yarn start:dev
$ # productin
$ yarn build
$ yarn start:prod

You can navigate to http://localhost:4000 to get to the GraphQL explorer to explorer the API.

Querying

JHU CSSE

{
  jhu(filter: {last:10000, country:"us"}) {
    data {
	total
      nodes {
        country
        state
        ...
      }
    }
  }
}

NY Times

{
  nytimes {
    counties {
      total
      nodes {
        cases
        ...
      }
    }
  }
  states {
    nodes {
      state
      ...
    }
  }
}

Filters

type JHUFilter {
  last: Float = 100
  from: DateTime
  state: String
  sort: SortCovidInputType
  country: String
}
type CountyFilter {
  last: Float = 100
  from: DateTime
  state: String
  sort: SortCovidInputType
  county: String
}
type StateFilter {
  last: Float = 100
  from: DateTime
  state: String
  sort: SortCovidInputType
}

License and Attribution

If you are using NY Times data please follow their License and Attribution guide. Other than that this project is open source and is accepting pull request and issue request!

Disclaimer: This is not an official server of the NYTimes or of JHU