Skip to content

Commit 82fa808

Browse files
committed
init
1 parent d43f124 commit 82fa808

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/graphql/eager_loader/resolver.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def self.included(klass)
99
end
1010

1111
def associations_to_include
12-
graphql_eager_load_options(model: @@eager_load_model)
12+
graphql_eager_load_options(model: self.class.class_variable_get(:@@eager_load_model))
1313
end
1414

1515
def graphql_eager_load_options(selections: context.query.lookahead.selections, model:)
@@ -20,7 +20,9 @@ def graphql_eager_load_options(selections: context.query.lookahead.selections, m
2020
# in the graphql query for this resolver.
2121
module ClassMethods
2222
def eager_load_model(model)
23-
@eager_load_model = model
23+
# rubocop:disable Style/ClassVars
24+
class_variable_set(:@@eager_load_model, model)
25+
# rubocop:enable Style/ClassVars
2426
end
2527
end
2628
end

0 commit comments

Comments
 (0)