blob: b06cb3b1e32c75e9da53d57361754105e08fdf5e (
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
35
36
37
38
39
40
|
# frozen_string_literal: true
module Mutations
module Boards
module Lists
class BaseUpdate < BaseMutation
argument :position, GraphQL::INT_TYPE,
required: false,
description: 'Position of list within the board.'
argument :collapsed, GraphQL::BOOLEAN_TYPE,
required: false,
description: 'Indicates if the list is collapsed for this user.'
def resolve(list: nil, **args)
if list.nil? || !can_read_list?(list)
raise_resource_not_available_error!
end
update_result = update_list(list, args)
{
list: update_result.payload[:list],
errors: update_result.errors
}
end
private
def update_list(list, args)
raise NotImplementedError
end
def can_read_list?(list)
raise NotImplementedError
end
end
end
end
end
|