Welcome to mirror list, hosted at ThFree Co, Russian Federation.

base.rb « issues « mutations « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b7fa234a50bc672002e166393d2bb602e36d9890 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# frozen_string_literal: true

module Mutations
  module Issues
    class Base < BaseMutation
      include Mutations::ResolvesProject

      argument :project_path, GraphQL::ID_TYPE,
               required: true,
               description: "The project the issue to mutate is in"

      argument :iid, GraphQL::STRING_TYPE,
               required: true,
               description: "The iid of the issue to mutate"

      field :issue,
            Types::IssueType,
            null: true,
            description: "The issue after mutation"

      authorize :update_issue

      private

      def find_object(project_path:, iid:)
        project = resolve_project(full_path: project_path)
        resolver = Resolvers::IssuesResolver
          .single.new(object: project, context: context)

        resolver.resolve(iid: iid)
      end
    end
  end
end