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

wrong number of arguments (given 2, expected 0..1) in Ruby 3 #12

Open
andypearson opened this issue Jun 12, 2021 · 3 comments
Open

wrong number of arguments (given 2, expected 0..1) in Ruby 3 #12

andypearson opened this issue Jun 12, 2021 · 3 comments

Comments

@andypearson
Copy link

andypearson commented Jun 12, 2021

GraphQL::Schema.execute uses keyword args, but the execute_graphql helper passes them as a hash.

I think this works fine in Ruby 2.6, but Ruby 3 no longer converts hashes to keyword args automatically, and instead I see this error:

wrong number of arguments (given 2, expected 0..1)

For the moment I am using the following work around:

class SchemaWrapper
  def self.execute(query, options)
    PaintPadSchema.execute(query, **options)
  end
end

RSpec::GraphQLResponse.configure { |config| config.graphql_schema = SchemaWrapper }
@abdul-hamid-achik
Copy link

thanks @andypearson

aki77 added a commit to aki77/rspec-graphql_response that referenced this issue Oct 12, 2021
@darrunategui
Copy link

Wondering if this gem is still being actively maintained. Since there is a pull request (#13) to fix this, could we get eyes from this gem's maintainer?

@dflynn15 @mxriverlynn

@callahat
Copy link

@jasonkarns Do you know if this gem is still being maintained?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants