# Simple rails application ### Model setup ``` rails g model book title:string rails db:migrate ``` Add some data to the model ``` rails c Book.create! title: "Active Rails" ``` Setup a graphql object to represent books ``` rails g graphql:object Book ``` To use the generated type, we can declare a field over in `app/graphql/types/query_type.rb`. We'll delete the example one that is there at the moment and turn this file into this: ```ruby module Types class QueryType < Types::BaseObject field :books, [Types::BookType], null: false def books Book.all end end end ``` ### Components controller setup ``` rails g controller components index ```