batch-loader icon indicating copy to clipboard operation
batch-loader copied to clipboard

Incompatibility with graphql-ruby 2.0.18+

Open swrobel opened this issue 1 year ago • 2 comments

It seems there was a breaking change introduced in 2.0.18 that causes use BatchLoader::GraphQL to cause the following exception:

vendor/bundle/ruby/3.2.0/gems/graphql-2.0.19/lib/graphql/schema.rb:944:in `tracer': Can't add tracer after configuring a `trace_class`, use GraphQL::Tracing::LegacyTrace to merge legacy tracers into a trace class instead.
  raise ArgumentError, "Can't add tracer after configuring a `trace_class`, use GraphQL::Tracing::LegacyTrace to merge legacy tracers into a trace class instead."
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (ArgumentError)
from vendor/bundle/ruby/3.2.0/gems/batch-loader-2.0.1/lib/batch_loader/graphql.rb:10:in `use'
from vendor/bundle/ruby/3.2.0/gems/graphql-2.0.19/lib/graphql/schema.rb:243:in `use'

swrobel avatar Mar 19 '23 17:03 swrobel

I'm also seeing this issue in my application. I am working around it for the moment by locking the graphql gem version to 2.0.17:

gem "graphql", "~> 2.0", "<= 2.0.17"

chriswright47 avatar Apr 26 '23 19:04 chriswright47

Is it broken specifically with that version, or with all onwards versions? (did graphql-rb revert this?)

sodabrew avatar Aug 14 '23 17:08 sodabrew