Open mhuggins opened 3 months ago
As a workaround, create a lib/tasks/assets.rake
file with the following:
# frozen_string_literal: true
Rake::Task['assets:precompile'].clear
namespace :assets do
task precompile: :environment do
# noop
end
end
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