Skip to content

Commit

Permalink
Deprecate BatchLoader.for in GraphQL
Browse files Browse the repository at this point in the history
  • Loading branch information
exAspArk committed Apr 8, 2020
1 parent f1796de commit ac18160
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/batch_loader/graphql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def self.for(item)
end

def self.wrap(batch_loader)
warn "DEPRECATION WARNING: using BatchLoader.for in GraphQL is deprecated. Use BatchLoader::GraphQL.for instead or return BatchLoader::GraphQL.wrap from your resolver."

BatchLoader::GraphQL.new.tap do |graphql|
graphql.batch_loader = batch_loader
end
Expand Down

0 comments on commit ac18160

Please sign in to comment.