Skip to content

Commit

Permalink
Release v2.0.1. Actually fix compatibility with Ruby 3, update specs
Browse files Browse the repository at this point in the history
  • Loading branch information
exAspArk committed Feb 18, 2021
1 parent 8b2a745 commit 03d5153
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ one of the following labels: `Added`, `Changed`, `Deprecated`,
to manage the versions of this gem so
that you can set version constraints properly.

#### [Unreleased](https://github.com/exAspArk/batch-loader/compare/v2.0.0...HEAD)
#### [Unreleased](https://github.com/exAspArk/batch-loader/compare/v2.0.1...HEAD)

* WIP

#### [v2.0.1](https://github.com/exAspArk/batch-loader/compare/v2.0.0...v2.0.1) - 2021-02-18

* `Fixed`: Compatibility with GraphQL and Ruby 3. [#71](https://github.com/exAspArk/batch-loader/pull/71)

#### [v2.0.0](https://github.com/exAspArk/batch-loader/compare/v1.5.0...v2.0.0) - 2021-02-18

* `Removed`: Support for GraphQL version <= 1.7. [#75](https://github.com/exAspArk/batch-loader/pull/75)
Expand Down
4 changes: 2 additions & 2 deletions lib/batch_loader/graphql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def initialize(item = nil)
@batch_loader = BatchLoader.for(item)
end

def batch(*kwargs, &block)
@batch_loader.batch(*kwargs, &block)
def batch(**kwargs, &block)
@batch_loader.batch(**kwargs, &block)
self
end

Expand Down
2 changes: 1 addition & 1 deletion lib/batch_loader/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

class BatchLoader
VERSION = "2.0.0"
VERSION = "2.0.1"
end
4 changes: 2 additions & 2 deletions spec/fixtures/graphql_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ class PostType < GraphQL::Schema::Object
field :user_old, UserType, null: false

def user
BatchLoader::GraphQL.for(object.user_id).batch do |user_ids, loader|
BatchLoader::GraphQL.for(object.user_id).batch(default_value: nil) do |user_ids, loader|
User.where(id: user_ids).each { |user| loader.call(user.id, user) }
end
end

def user_old
BatchLoader.for(object.user_id).batch do |user_ids, loader|
BatchLoader.for(object.user_id).batch(default_value: nil) do |user_ids, loader|
User.where(id: user_ids).each { |user| loader.call(user.id, user) }
end
end
Expand Down

0 comments on commit 03d5153

Please sign in to comment.