Class: Gitlab::Graphql::Loaders::IssuableLoader
- Inherits:
-
Object
- Object
- Gitlab::Graphql::Loaders::IssuableLoader
- Defined in:
- lib/gitlab/graphql/loaders/issuable_loader.rb
Defined Under Namespace
Classes: BatchKey
Instance Attribute Summary collapse
-
#issuable_finder ⇒ Object
readonly
Returns the value of attribute issuable_finder.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #batching_find_all(&with_query) ⇒ Object
- #find_all ⇒ Object
-
#initialize(parent, issuable_finder) ⇒ IssuableLoader
constructor
A new instance of IssuableLoader.
Constructor Details
#initialize(parent, issuable_finder) ⇒ IssuableLoader
Returns a new instance of IssuableLoader.
11 12 13 14 |
# File 'lib/gitlab/graphql/loaders/issuable_loader.rb', line 11 def initialize(parent, issuable_finder) @parent = parent @issuable_finder = issuable_finder end |
Instance Attribute Details
#issuable_finder ⇒ Object (readonly)
Returns the value of attribute issuable_finder.
7 8 9 |
# File 'lib/gitlab/graphql/loaders/issuable_loader.rb', line 7 def issuable_finder @issuable_finder end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
7 8 9 |
# File 'lib/gitlab/graphql/loaders/issuable_loader.rb', line 7 def parent @parent end |
Instance Method Details
#batching_find_all(&with_query) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/gitlab/graphql/loaders/issuable_loader.rb', line 16 def batching_find_all(&with_query) if issuable_finder.params.keys == ['iids'] issuable_finder.parent = parent batch_load_issuables(issuable_finder.params[:iids], with_query) else post_process(find_all, with_query) end end |
#find_all ⇒ Object
25 26 27 28 |
# File 'lib/gitlab/graphql/loaders/issuable_loader.rb', line 25 def find_all issuable_finder.parent_param = parent if parent issuable_finder.execute end |