Skip to content

Commit

Permalink
Merge pull request #153 from Shopify/shapes-friendliness
Browse files Browse the repository at this point in the history
Improve Shapes Friendliness of Batch::Loader
  • Loading branch information
casperisfine authored Jan 16, 2023
2 parents 8873ffd + 25d0520 commit 8afc76f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/graphql/batch/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def current_executor

attr_accessor :loader_key, :executor

def initialize
@loader_key = nil
@executor = nil
@queue = nil
@cache = nil
end

def load(key)
cache[cache_key(key)] ||= begin
queue << key
Expand Down

0 comments on commit 8afc76f

Please sign in to comment.