Closed madamkiwi closed 9 months ago
@madamkiwi I'm sorry I'm a bit confused by the request. I'd like to help but I'll need some clarification.
The stacktrace I see seems related to a GraphQL query executed using graphlient
(which internally uses Faraday), but the issue title and description mention the ActiveRecord DatabaseResolver. I'm not really sure of how the two are connected?
Focusing on the GraphQL issue, I understand this error is popping up while running tests, and the last code block in your issue description shows how you setup the Graphlient::Client
. Since you're using the Faraday::Adapter::Rack
adapter, you need to provide a suitable rack app to process your test calls. Effectively, this acts as a mock service for your tests.
Considering your error is being raised by the rack
gem, I suspect your rack app has not been configured correctly.
My guess is that you're trying to follow this guide to test your GraphQL client, so I'd suggest one of the following:
app
in c.adapter Faraday::Adapter::Rack, app
) and make sure there are no issues with itgraphlient
supports more.graphlient
project: since this error does not originate from Faraday, it's hard for me to help further, so I'd suggest reaching out to the graphlient
team instead asking for help.I don't think I will be able to help further with this issue, so I'm going to close it for now in the hope that the pointers above can be helpful. Feel free to update with additional details if you see anything else pointing to Faraday
Thanks for helping out, and you're right that the actual issue is not on Faraday, this is the real issue: https://github.com/rmosolgo/graphql-ruby/issues/2929
Glad I could help! And thank you for sharing the link to the real issue, I'm sure that will help people in future.
Basic Info
Issue description
Please provide a description of the issue you're experiencing. I'm having trouble getting Faraday adapter to work when enabling the ActiveRecord automatic connection switching feature. See ActiveRecord::Middleware::DatabaseSelector
If we cannot overwrite the active record resolver, is there a way to configure Faraday http adapter to redirect to multiple databases?
Please also provide the exception message/stacktrace or any other useful detail.
Steps to reproduce
If possible, please provide the steps to reproduce the issue. Add the following in application.rb to let Rails automatically switch connection to multiple databases:
Run graphql client