Skip to content

Conversation

@rmosolgo
Copy link
Owner

@rmosolgo rmosolgo commented Jan 19, 2026

Fixes #5500

At least, I think it should fix that issue, but my tests fail with:

NameError (undefined local variable or method 'graphql_dashboard' for an instance of #<Class:0x000000012a0324f8>)

which is raised from the .html.erb views code. graphql_dashboard.<some_view_path> works fine in the test files, but not in the views 😖

I have been trying to trace through initializer code and RouteSet code to figure out what's missing, but I haven't been able
to.

UPDATE: Trying to debug, I tried calling the route methods in the engine's controller methods, ie def show; puts graphql_dashboard.delete_all_detailed_traces_path; end. It raised a more helpful error:

In order to use #url_for, you must include routing helpers explicitly. For instance, `include Rails.application.routes.url_helpers`

And indeed, including the url helpers (the engine's url helpers in this case) did fix my problem. In order to keep the routes lazy-loaded, I put the .include call inside the routes do ... end block.

@rmosolgo
Copy link
Owner Author

👋 @francescoparra could you try this branch in your app?

gem "graphql", github: "rmosolgo/graphql-ruby", ref: "f903cb57b054ee4ed40600e032ad43f03ed958d1"

It moves the routes into lazily-evaluated block and adds a manual .include call to keep things working properly. Let me know how it goes if you give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GraphQL Dashboard Engine Breaks Devise Authentication in Production

2 participants