diff --git a/lib/graphql/batch/loader.rb b/lib/graphql/batch/loader.rb index 646edf2..11da284 100644 --- a/lib/graphql/batch/loader.rb +++ b/lib/graphql/batch/loader.rb @@ -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