Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider removing Faraday as a dependency and default to Net::HTTP #30

Open
dblock opened this issue Oct 26, 2017 · 4 comments
Open

Consider removing Faraday as a dependency and default to Net::HTTP #30

dblock opened this issue Oct 26, 2017 · 4 comments

Comments

@dblock
Copy link
Collaborator

dblock commented Oct 26, 2017

Followup from #7 and #29. Currently we require Faraday and default to Graphlient::Adapters::HTTP::FaradayAdapter. We could default to Graphlient::Adapters::HTTP::HTTPAdapter and remove Faraday as a required dependency, but we lose the nice RSpec integration by default in which you can use a Faraday middleware

  let(:client) do
    Graphlient::Client.new('http://test-graphql.biz/graphql') do |client|
      client.http do |h|
        h.connection do |c|
          c.use Faraday::Adapter::Rack, app
        end
      end
    end
  end
@papile
Copy link

papile commented Mar 24, 2022

Note: Having the dependency of faraday_middleware locks Faraday to 1 or lower as Faraday 2 is not compatible with it. So if someone updates their stack or uses Faraday 2, and Graphlient, RubyGems dependency resolution will bring in graphlient 0.0.5 which was the last one without Faraday.

@dblock
Copy link
Collaborator Author

dblock commented Mar 25, 2022

@papile Give upgrading Faraday in this gem a try? Looks fairly non-trivial.

@papile
Copy link

papile commented Mar 25, 2022

I could make the Faraday adapter 1/2 compatible by dropping faraday_middleware. Another thing though might be to drop the Faraday dependency from the gemspec so it is not pulled in as a hard dependency as this original request mentions. Then developers would have to explicitly enable the Faraday adapter (or it could be selected if Faraday is defined). The default can be Net::HTTP, and the gem can be listed as a development dependency only for specs.

Faraday has been a difficult dependency in the Ruby world since they stayed at version 0.x for a really long time, got a lot of adoption, then released breaking versions 1 and then 2. So whenever they release a breaking major release it causes a large headache in updating gems.

@dblock
Copy link
Collaborator Author

dblock commented Mar 26, 2022

@papile We'll take anything that has all the specs passing :)

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

No branches or pull requests

2 participants