diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-19 21:06:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-19 21:06:22 +0000 |
commit | 3d5ad15d2bf62ca70b1628afb64c5476e408781c (patch) | |
tree | 1f6906c1ee4b1b5652734e0a46d32b87ef9b27a0 /app/graphql | |
parent | d2801eda8464e5e9ce730caf30111c1190fe87a0 (diff) | |
download | gitlab-ce-3d5ad15d2bf62ca70b1628afb64c5476e408781c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql')
-rw-r--r-- | app/graphql/resolvers/todo_resolver.rb | 50 |
1 files changed, 6 insertions, 44 deletions
diff --git a/app/graphql/resolvers/todo_resolver.rb b/app/graphql/resolvers/todo_resolver.rb index 38a4539f34a..cff65321dc0 100644 --- a/app/graphql/resolvers/todo_resolver.rb +++ b/app/graphql/resolvers/todo_resolver.rb @@ -38,53 +38,15 @@ module Resolvers private - # TODO: Support multiple queries for e.g. state and type on TodosFinder: - # - # https://gitlab.com/gitlab-org/gitlab/merge_requests/18487 - # https://gitlab.com/gitlab-org/gitlab/merge_requests/18518 - # - # As soon as these MR's are merged, we can refactor this to query by - # multiple contents. - # def todo_finder_params(args) { - state: first_state(args), - type: first_type(args), - group_id: first_group_id(args), - author_id: first_author_id(args), - action_id: first_action(args), - project_id: first_project(args) + state: args[:state], + type: args[:type], + group_id: args[:group_id], + author_id: args[:author_id], + action_id: args[:action], + project_id: args[:project_id] } end - - def first_project(args) - first_query_field(args, :project_id) - end - - def first_action(args) - first_query_field(args, :action) - end - - def first_author_id(args) - first_query_field(args, :author_id) - end - - def first_group_id(args) - first_query_field(args, :group_id) - end - - def first_state(args) - first_query_field(args, :state) - end - - def first_type(args) - first_query_field(args, :type) - end - - def first_query_field(query, field) - return unless query.key?(field) - - query[field].first if query[field].respond_to?(:first) - end end end |