diff options
Diffstat (limited to 'app/graphql/resolvers/issue_status_counts_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/issue_status_counts_resolver.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/graphql/resolvers/issue_status_counts_resolver.rb b/app/graphql/resolvers/issue_status_counts_resolver.rb index 466ca538467..0b26b9def54 100644 --- a/app/graphql/resolvers/issue_status_counts_resolver.rb +++ b/app/graphql/resolvers/issue_status_counts_resolver.rb @@ -7,7 +7,21 @@ module Resolvers type Types::IssueStatusCountsType, null: true def continue_issue_resolve(parent, finder, **args) + finder.params[parent_param(parent)] = parent if parent Gitlab::IssuablesCountForState.new(finder, parent) end + + private + + def parent_param(parent) + case parent + when Project + :project_id + when Group + :group_id + else + raise "Unexpected type of parent: #{parent.class}. Must be Project or Group" + end + end end end |