Building a COVID-19 live tracker API with Rails 6 and GraphQL

  1. Create a new Rails API app called corona-ql
rails new corona-ql --api --database=postgresql --skip-yarn --skip-action-mailer --skip-action-cable --skip-coffee --skip-javascript --skip-turbolinks
cd corona-ql
rails g model Country country_name
rails g model Summaries
rails db:create db:migrate
rails g graphql:install
rails db:seed
rails c
Country.all
rails g graphql:object country
rails g graphql:object summary
Querying out find_country field
Querying our country_filter field

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store