1.rails new graphql-demo 2. cd graphql-demo 3. git init 4. git commit -m 'Initial commit' 5. git add . 6. git commit -m 'Initial commit' 7. touch .ruby-gemset 8. bundle install 9. rails generate graphql:install 10. git add . 11. git commit -m 'GraphQL base setup'
- rails g model user id:integer first_name:string last_name:string email:string
- rails g model post id:integer user_id:integer content:text
- rails db:migrate
- git add .
- git commit -m 'User and Post model/migration'
- rails g graphql:object -h
- rails g graphql:object User
- Create some user data
- start rails server and navigate to
http://localhost:3000/graphiql
- Create some seed data
- rails g graphql:input -h
- rails g graphql:input User
- rails g graphql:mutation_create User
- rails g graphql:mutation_update User
- rails g graphql:mutation_delete User