*Goal of this chapter
*Related official docs part
1. Install graphql-ruby gem
rails g graphql:install
Running via Spring preloader in process 49714
route post "/graphql", to: "graphql#execute"
Skipped graphiql, as this rails project is API only
You may wish to use GraphiQL.app for development: https://github.com/skevy/graphiql-app
*Don't be afraid of the files created!
We stop here. Later we create
2. Install graphiql-rails gem
Graphiql is tool like below. we will use it later.
I use subdomain for api
constraints subdomain: 'api' do
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql"
post "/graphql", to: "graphql#execute"
*This is only needed if you use subdomain.
config.action_dispatch.tld_length = 0