I currently deployed an app with rails + graphql to heroku, although the url localhost:3000/graphiql
works perfectly locally, after uploading the application to heroku (I have created a static page as root home) and connecting to the url/ grahpql or graphiql it seems that it is not installed in the application that was uploaded (by web interface) my routes file is the following:
Rails.application.routes.draw do
if Rails.env.development?
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql"
end
post "/graphql", to: "graphql#execute"
mount ActionCable.server, at: '/cable'
root 'static_pages#home'
end
Isn't there some kind of modification in the conditional that calls the env development or something like that that identifies me a route for production?
It is recommended to enable
graphiql
it only in a development environment, mainly because of the power that the interface may eventually have over your production data.If you want to enable it anyway, deleting the condition
if Rails.env.development?
should be enough, or if you want to enable it only on dev/prod, trymaking sure the gem is also enabled for both environments in your
Gemfile
.