graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

Adding railtie to rails configuration throws exception "missing keyword: schema"

Open mlandauer opened this issue 7 years ago • 2 comments

Following the directions in https://github.com/github/graphql-client/blob/master/guides/rails-configuration.md I added require "graphql/client/railtie" to my application.rb.

Then on rails startup:

/usr/local/bundle/gems/graphql-client-0.13.0/lib/graphql/client.rb:93:in `initialize': missing keyword: schema (ArgumentError)
	from /usr/local/bundle/gems/graphql-client-0.13.0/lib/graphql/client/railtie.rb:17:in `new'
	from /usr/local/bundle/gems/graphql-client-0.13.0/lib/graphql/client/railtie.rb:17:in `<class:Railtie>'
	from /usr/local/bundle/gems/graphql-client-0.13.0/lib/graphql/client/railtie.rb:15:in `<class:Client>'
	from /usr/local/bundle/gems/graphql-client-0.13.0/lib/graphql/client/railtie.rb:7:in `<module:GraphQL>'
	from /usr/local/bundle/gems/graphql-client-0.13.0/lib/graphql/client/railtie.rb:6:in `<top (required)>'
	from /usr/local/bundle/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
	from /usr/local/bundle/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
	from /usr/local/bundle/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
	from /usr/local/bundle/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
	from /app/config/application.rb:11:in `<top (required)>'
	from /usr/local/bundle/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
	from /usr/local/bundle/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
	from /usr/local/bundle/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
	from /usr/local/bundle/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
	from /usr/local/bundle/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
	from /usr/local/bundle/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
	from /usr/local/bundle/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
	from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /usr/local/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from -e:1:in `<main>'

I did this to try out the erb integration.

It looks to me like the commit https://github.com/github/graphql-client/commit/4c2dc66a8933fd77f064f17c5ccd8b3bb8c3e6b0 from about 2 months ago might be the culprit. It seems to be a case of the initializer signature changing.

mlandauer avatar Oct 25 '18 02:10 mlandauer

On a little further investigation it looks to me like this is the same problem that the PR https://github.com/github/graphql-client/pull/136 was supposed to fix.

mlandauer avatar Oct 25 '18 20:10 mlandauer

I can confirm this issue. Seems like it's not possible to use the railtie, which means that the ERB integration cannot work.

Mange avatar Feb 13 '19 11:02 Mange