You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building a GraphQL API, it can be useful to include GraphiQL for users to interact with the GraphQL API via the web. GraphiQL is the typical approach to providing such an interface. However, the graphiql-rails ruby gem depends on propshaft or sprockets being installed as well to serve the JS & CSS.
Because the ruby nixpack determines if a Rails app is API-only by checking for the existence of "propshaft" or "sprockets" in the app's Gemfile, it's getting false-positives.
To address this, I would suggest searching in either config/application.rb for the string config.api_only = true or app/application_controller.rb for the string ActionController::API instead.
To reproduce
Create a rails app that is API-only: rails new my-api-app --api
Add graphql, graphiql-rails, & propshaft dependencies to Gemfile:
gem'graphiql-rails'gem'graphql'gem'propshaft'
Install gems: bundle install
Add route to config/routes.rb for GraphQL & GraphiQL:
Is there an existing issue for this?
Describe the bug
When building a GraphQL API, it can be useful to include GraphiQL for users to interact with the GraphQL API via the web. GraphiQL is the typical approach to providing such an interface. However, the
graphiql-rails
ruby gem depends onpropshaft
orsprockets
being installed as well to serve the JS & CSS.Because the ruby nixpack determines if a Rails app is API-only by checking for the existence of "propshaft" or "sprockets" in the app's
Gemfile
, it's getting false-positives.To address this, I would suggest searching in either
config/application.rb
for the stringconfig.api_only = true
orapp/application_controller.rb
for the stringActionController::API
instead.To reproduce
rails new my-api-app --api
Gemfile
:bundle install
config/routes.rb
for GraphQL & GraphiQL:Expected behavior
The ruby nixpack should not run
bundle exec rake assets:precompile
.Environment
Railsway.app deployment
The text was updated successfully, but these errors were encountered: