Skip to content

Poilon/graphql-rails-api-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This example has made it live through these commands

rails new graphql-rails-api-example --database=postgresql --api

Create the DB

cd graphql-rails-api-example
rails db:create

then added the gems to the Gemfile

gem 'graphql'
gem 'graphql-rails-api'

Install the gems

bundle

Install graphql_rails_api

rails generate graphql_rails_api:install

Generate resources

rails generate graphql_resource user email:string first_name:string last_name:string authentication_token:string
rails generate graphql_resource hdd ref:string
rails generate graphql_resource computer ref:string description:text belongs_to:user has_many:hdds
rails generate graphql_resource motherboard ref:string belongs_to:computer
rails generate graphql_resource graphics_card ref:string belongs_to:computer
rails generate graphql_resource component_tag code:string many_to_many:motherboards many_to_many:graphics_cards many_to_many:hdds

Done !

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published