diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/graphql/resolvers/issues_resolver.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/graphql/resolvers/issues_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/issues_resolver.rb | 61 |
1 files changed, 2 insertions, 59 deletions
diff --git a/app/graphql/resolvers/issues_resolver.rb b/app/graphql/resolvers/issues_resolver.rb index 9d0535a208f..e2874f6643c 100644 --- a/app/graphql/resolvers/issues_resolver.rb +++ b/app/graphql/resolvers/issues_resolver.rb @@ -2,49 +2,11 @@ module Resolvers class IssuesResolver < BaseResolver - argument :iid, GraphQL::STRING_TYPE, - required: false, - description: 'IID of the issue. For example, "1"' + prepend IssueResolverFields - argument :iids, [GraphQL::STRING_TYPE], - required: false, - description: 'List of IIDs of issues. For example, [1, 2]' argument :state, Types::IssuableStateEnum, required: false, description: 'Current state of this issue' - argument :label_name, GraphQL::STRING_TYPE.to_list_type, - required: false, - description: 'Labels applied to this issue' - argument :milestone_title, GraphQL::STRING_TYPE.to_list_type, - required: false, - description: 'Milestones applied to this issue' - argument :assignee_username, GraphQL::STRING_TYPE, - required: false, - description: 'Username of a user assigned to the issues' - argument :assignee_id, GraphQL::STRING_TYPE, - required: false, - description: 'ID of a user assigned to the issues, "none" and "any" values supported' - argument :created_before, Types::TimeType, - required: false, - description: 'Issues created before this date' - argument :created_after, Types::TimeType, - required: false, - description: 'Issues created after this date' - argument :updated_before, Types::TimeType, - required: false, - description: 'Issues updated before this date' - argument :updated_after, Types::TimeType, - required: false, - description: 'Issues updated after this date' - argument :closed_before, Types::TimeType, - required: false, - description: 'Issues closed before this date' - argument :closed_after, Types::TimeType, - required: false, - description: 'Issues closed after this date' - argument :search, GraphQL::STRING_TYPE, - required: false, - description: 'Search query for issue title or description' argument :sort, Types::IssueSortEnum, description: 'Sort issues by this criteria', required: false, @@ -56,19 +18,7 @@ module Resolvers label_priority_asc label_priority_desc milestone_due_asc milestone_due_desc].freeze - def resolve(**args) - # The project could have been loaded in batch by `BatchLoader`. - # At this point we need the `id` of the project to query for issues, so - # make sure it's loaded and not `nil` before continuing. - parent = object.respond_to?(:sync) ? object.sync : object - return Issue.none if parent.nil? - - # Will need to be be made group & namespace aware with - # https://gitlab.com/gitlab-org/gitlab-foss/issues/54520 - args[:iids] ||= [args.delete(:iid)].compact if args[:iid] - args[:attempt_project_search_optimizations] = true if args[:search].present? - - finder = IssuesFinder.new(current_user, args) + def continue_issue_resolve(parent, finder, **args) issues = Gitlab::Graphql::Loaders::IssuableLoader.new(parent, finder).batching_find_all if non_stable_cursor_sort?(args[:sort]) @@ -80,13 +30,6 @@ module Resolvers end end - def self.resolver_complexity(args, child_complexity:) - complexity = super - complexity += 2 if args[:labelName] - - complexity - end - def non_stable_cursor_sort?(sort) NON_STABLE_CURSOR_SORTS.include?(sort) end |