blob: 2508125d392e11ab5651c992442d792bc1d19388 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# frozen_string_literal: true
module Resolvers
module WorkItems
class TypesResolver < BaseResolver
type Types::WorkItems::TypeType.connection_type, null: true
argument :taskable, ::GraphQL::Types::Boolean,
required: false,
description: 'If `true`, only taskable work item types will be returned.' \
' Argument is experimental and can be removed in the future without notice.'
def resolve(taskable: nil)
# This will require a finder in the future when groups/projects get their work item types
# All groups/projects use the default types for now
base_scope = ::WorkItems::Type.default
base_scope = base_scope.by_type(:task) if taskable
base_scope.order_by_name_asc
end
end
end
end
|