Breaks due to changes in graphql 2.3.5
eizengan opened this issue · 4 comments
After updating dependencies in a project using this gem we have begun to see failures during query parsing:
Caused by NoMethodError: undefined method 'map' for nil
from...gems/graphql-client-0.22.0/lib/graphql/client/schema/interface_type.rb:24:in `define_class'
At a(n uninformed) glance, this appears to be somehow related to graphql 2.3.5 switching from string-based to class-based keys here:
Using graphql 2.3.4
[3] pry(#<Module:0x00000001363208c0>::Actor)> definition.client.possible_types
=> {"__Schema"=>[#<Class:0x000000012ff71680>],
"__Type"=>[#<Class:0x000000012ff71360>],
"__Field"=>[#<Class:0x000000012ff71040>],
"__Directive"=>[#<Class:0x000000012ff70d20>],
...
Using graphql 2.3.5:
[2] pry(#<Module:0x00000001363208c0>::Actor)> definition.client.possible_types
=> {#<Class:0x0000000136325640>=>[#<Class:0x0000000136325640>],
#<Class:0x0000000136325280>=>[#<Class:0x0000000136325280>],
#<Class:0x0000000136324f60>=>[#<Class:0x0000000136324f60>],
#<Class:0x0000000136324c40>=>[#<Class:0x0000000136324c40>],
#<Class:0x0000000136324920>=>[#<Class:0x0000000136324920>],
Hey, thanks for reporting this! Yes, I bet you're right about the cause. I forgot about the possibility of outside callers of this method 😖
I worked up a patch in #28 and I'm going to update the GraphQL-Ruby changelog to mention this as a breaking change.
Cool - we'll pin the dependency in our gemfile until that fix releases. Didn't expect a super-fast turnaround, but I'm certainly grateful for it!
v0.23.0 is on Rubygems with this fix -- please let me know if you have any more trouble with it!