Skip to content

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

@andypearson

Description

@andypearson

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 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions