Skip to content

Update graphql gem to 1.13.x #264

Open
@ahukkanen

Description

@ahukkanen

When doing the Ruby 3 upgrade, I noticed that upgrading the graphql gem to 1.13.x causes a lot of the following kind of errors:

Called on #<Class:0x0000555b1dc9d308> from:
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-guard-2.0.0/lib/graphql/guard.rb:17:in `block in <class:Guard>'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/filter.rb:32:in `call'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/filter.rb:12:in `call'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/filter.rb:12:in `call'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/filter.rb:32:in `call'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/filter.rb:12:in `call'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:94:in `block in initialize'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:329:in `block in read_through'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:325:in `visible?'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:226:in `block in visible_type?'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:329:in `block in read_through'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:227:in `visible_type?'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:238:in `block in visible_and_reachable_type?'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:329:in `block in read_through'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:250:in `visible_and_reachable_type?'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:215:in `visible_field?'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:63:in `public_send'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:63:in `visible_entry?'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/member/has_fields.rb:46:in `block in get_field'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/member/has_fields.rb:42:in `each'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/member/has_fields.rb:42:in `get_field'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema.rb:1264:in `get_field'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:139:in `block (2 levels) in get_field'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:329:in `block in read_through'
  /.../versions/3.0.2/lib/ruby/gems/3.0.0/gems/graphql-1.13.11/lib/graphql/schema/warden.rb:148:in `get_field'
Legacy `.graphql_definition` objects are deprecated and will be removed in GraphQL-Ruby 2.0. Remove `.graphql_definition` to use a class-based definition instead.

It is apparently some compatibility issue with the graphql-guard gem judging by the stack trace but I did not find any particular issue referring to this problem in their repository. The closest one I found out was related to the deprecation message also seen in the bulletin board outputs (as above): exAspArk/graphql-guard#53

This issue needs to be further investigated and I would say the most likely candidate for this issue is with the graphql-guard integration. Another problem is that graphql-guard does not seem to support newer versions (> 2.x.x) of the graphql gem right now. It also seems that the graphql-guard project is at a stale state currently: exAspArk/graphql-guard#50

The last commit and last release of that gem was about 2 years ago, in April 2020.

Metadata

Metadata

Assignees

Labels

dependenciesPull requests that update a dependency file

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions