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 3135a6e commit 7bb3eea
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 @@ -33,6 +33,8 @@ def self.instrument(type, field)
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 7bb3eea

Please sign in to comment.