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

Update graphql gem to 1.13.x #264

Open
ahukkanen opened this issue Mar 31, 2022 · 2 comments
Open

Update graphql gem to 1.13.x #264

ahukkanen opened this issue Mar 31, 2022 · 2 comments
Assignees
Labels
dependencies Pull requests that update a dependency file

Comments

@ahukkanen
Copy link
Contributor

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.

@ahukkanen ahukkanen added the dependencies Pull requests that update a dependency file label Mar 31, 2022
@ahukkanen ahukkanen changed the title Upgrade graphql gem to 1.13.x Update graphql gem to 1.13.x Apr 6, 2022
@alecslupu
Copy link
Contributor

alecslupu commented Dec 21, 2022

From graphql-guard readme file, we can see that "this gem provides a field-level authorization for graphql-ruby".

We can clearly see that the graphql-ruby is already implementing this functionality, therefore, we can remove the graphql-guard in favor of native field authoriztion

In fact we can use any kind of authentication https://graphql-ruby.org/authorization/authorization.html

@paarals
Copy link
Contributor

paarals commented Oct 5, 2023

still happen, assign to @microstudi

@microstudi microstudi self-assigned this Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
No open projects
Status: Issues BB
Development

No branches or pull requests

4 participants