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

update.rb « lists « boards « mutations « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d17dd5162a01bc2dd84a7226870af9fac402bf3b (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
# frozen_string_literal: true

module Mutations
  module Boards
    module Lists
      class Update < BaseUpdate
        graphql_name 'UpdateBoardList'

        argument :list_id, Types::GlobalIDType[List],
                  required: true,
                  loads: Types::BoardListType,
                  description: 'Global ID of the list.'

        field :list,
              Types::BoardListType,
              null: true,
              description: 'Mutated list.'

        private

        def update_list(list, args)
          service = ::Boards::Lists::UpdateService.new(list.board, current_user, args)
          service.execute(list)
        end

        def can_read_list?(list)
          Ability.allowed?(current_user, :read_issue_board_list, list.board)
        end
      end
    end
  end
end