Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions lib/graphql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,7 @@ class << self
autoload :LoadApplicationObjectFailedError, "graphql/load_application_object_failed_error"
autoload :Testing, "graphql/testing"
autoload :Current, "graphql/current"
if defined?(::Rails::Engine)
# This needs to be defined before Rails runs `add_routing_paths`,
# otherwise GraphQL::Dashboard's routes won't have been gathered for loading
# when that initializer runs.
require 'graphql/dashboard'
end
autoload :Dashboard, "graphql/dashboard"
end

require "graphql/version"
Expand Down
4 changes: 4 additions & 0 deletions lib/graphql/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ class Railtie < Rails::Railtie
)
end
end

initializer('graphql.setup_dashboard', before: :add_routing_paths) do
require 'graphql/dashboard'
end
end
end
Loading