rmosolgo/graphql-ruby

Version 1.9.18 is not working in Ruby 3.3.3

sivagollapalli opened this issue · 3 comments

/Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/graphql-1.9.18/lib/graphql/deprecated_dsl.rb:38:in `include': Refinement#include has been removed (TypeError)

        include Methods
                ^^^^^^^
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/graphql-1.9.18/lib/graphql/deprecated_dsl.rb:38:in `block (2 levels) in <module:DeprecatedDSL>'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/graphql-1.9.18/lib/graphql/deprecated_dsl.rb:37:in `refine'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/graphql-1.9.18/lib/graphql/deprecated_dsl.rb:37:in `block in <module:DeprecatedDSL>'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/graphql-1.9.18/lib/graphql/deprecated_dsl.rb:36:in `each'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/graphql-1.9.18/lib/graphql/deprecated_dsl.rb:36:in `<module:DeprecatedDSL>'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/graphql-1.9.18/lib/graphql/deprecated_dsl.rb:15:in `<module:GraphQL>'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/graphql-1.9.18/lib/graphql/deprecated_dsl.rb:2:in `<top (required)>'
	from <internal:/Users/sivagollapalli/.rvm/rubies/ruby-3.3.3/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/Users/sivagollapalli/.rvm/rubies/ruby-3.3.3/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `block in require'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299:in `load_dependency'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `require'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/graphql-1.9.18/lib/graphql.rb:121:in `<top (required)>'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/bundler-2.4.14/lib/bundler/runtime.rb:60:in `require'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/bundler-2.4.14/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/bundler-2.4.14/lib/bundler/runtime.rb:55:in `each'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/bundler-2.4.14/lib/bundler/runtime.rb:55:in `block in require'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/bundler-2.4.14/lib/bundler/runtime.rb:44:in `each'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/bundler-2.4.14/lib/bundler/runtime.rb:44:in `require'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/bundler-2.4.14/lib/bundler.rb:187:in `require'
	from /Users/sivagollapalli/work/newswire/config/application.rb:21:in `<top (required)>'
	from <internal:/Users/sivagollapalli/.rvm/rubies/ruby-3.3.3/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/Users/sivagollapalli/.rvm/rubies/ruby-3.3.3/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `block in require'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:299:in `load_dependency'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/activesupport-6.1.7.3/lib/active_support/dependencies.rb:332:in `require'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/railties-6.1.7.3/lib/rails/commands/server/server_command.rb:138:in `block in perform'
	from <internal:kernel>:90:in `tap'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/railties-6.1.7.3/lib/rails/commands/server/server_command.rb:135:in `perform'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/thor-1.3.1/lib/thor.rb:527:in `dispatch'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/railties-6.1.7.3/lib/rails/command/base.rb:69:in `perform'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/railties-6.1.7.3/lib/rails/command.rb:48:in `invoke'
	from /Users/sivagollapalli/.rvm/gems/ruby-3.3.3/gems/railties-6.1.7.3/lib/rails/commands.rb:18:in `<top (required)>'
	from <internal:/Users/sivagollapalli/.rvm/rubies/ruby-3.3.3/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/Users/sivagollapalli/.rvm/rubies/ruby-3.3.3/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from bin/rails:4:in `<main>'

Looks like this is the reason. Now when I upgrade to version 1.12.24 this issue has been fixed. But looks like DSL has changed in 1.12.24 compare to 1.9.18. Now entire code base I need to make changes according new DSL which is tedious. So Could anyone suggest what would be better way to move forward?

Hi! Sorry for the trouble. I bet it's possible to modify graphql-ruby v1.9.18 to work on Ruby 3.3.3. Here's my suggestion:

  • First, create a version of v1.9.18 that will work with ruby 3.3.3:
    • Fork this repository and clone it to your computer
    • Check out the v1.9.18 tag and comment out these lines: https://github.com/rmosolgo/graphql-ruby/ blob/2f23a6d971ca1888387fb87848ad94962a955b49/lib/graphql/deprecated_dsl.rb#L36-L41
    • Check out a new branch with those changes, commit your changes, and push the branch to your fork of this repository
  • Then, update your application to use that customized version:
    • update your gemfile to have gem "graphql", github: "sivagollapalli/graphql-ruby", ref: "your-branch-name"
    • bundle update graphql to download the newly-configured gem
    • At the top of your schema file, call GraphQL::DeprecatedDSL.activate to add the ! method to GraphQL-Ruby types

I don't have plans to support this here but I'm happy to continue discussing this as you work through it. Please let me know what you find when you give it a try!

@rmosolgo Thanks it worked. Here is the my fork with fix. https://github.com/sivagollapalli/graphql-ruby

Glad to hear it! Thanks for sharing.