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 b775553
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ 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)
* `Changed`: GraphQL tests. [03d5153](https://github.com/exAspArk/batch-loader/commit/03d51537bc4033fd3aab42db3eee3e9e1cb365fa)

#### [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)
* `Fixed`: Compatibility with Ruby 3. [#71](https://github.com/exAspArk/batch-loader/pull/71)

#### [v1.5.0](https://github.com/exAspArk/batch-loader/compare/v1.4.1...v1.5.0) - 2020-04-20

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 b775553

Please sign in to comment.