@@ -36,25 +36,22 @@ class IssueType < BaseObject
36
36
end
37
37
38
38
field :author , Types ::UserType , null : false ,
39
- description : 'User that created the issue' ,
40
- resolve : -> ( obj , _args , _ctx ) { Gitlab ::Graphql ::Loaders ::BatchModelLoader . new ( User , obj . author_id ) . find }
39
+ description : 'User that created the issue'
41
40
42
41
field :assignees , Types ::UserType . connection_type , null : true ,
43
42
description : 'Assignees of the issue'
44
43
45
44
field :labels , Types ::LabelType . connection_type , null : true ,
46
45
description : 'Labels of the issue'
47
46
field :milestone , Types ::MilestoneType , null : true ,
48
- description : 'Milestone of the issue' ,
49
- resolve : -> ( obj , _args , _ctx ) { Gitlab ::Graphql ::Loaders ::BatchModelLoader . new ( Milestone , obj . milestone_id ) . find }
47
+ description : 'Milestone of the issue'
50
48
51
49
field :due_date , Types ::TimeType , null : true ,
52
50
description : 'Due date of the issue'
53
51
field :confidential , GraphQL ::BOOLEAN_TYPE , null : false ,
54
52
description : 'Indicates the issue is confidential'
55
53
field :discussion_locked , GraphQL ::BOOLEAN_TYPE , null : false ,
56
- description : 'Indicates discussion is locked on the issue' ,
57
- resolve : -> ( obj , _args , _ctx ) { !!obj . discussion_locked }
54
+ description : 'Indicates discussion is locked on the issue'
58
55
59
56
field :upvotes , GraphQL ::INT_TYPE , null : false ,
60
57
description : 'Number of upvotes the issue has received'
@@ -108,6 +105,18 @@ class IssueType < BaseObject
108
105
109
106
field :severity , Types ::IssuableSeverityEnum , null : true ,
110
107
description : 'Severity level of the incident'
108
+
109
+ def author
110
+ Gitlab ::Graphql ::Loaders ::BatchModelLoader . new ( User , object . author_id ) . find
111
+ end
112
+
113
+ def milestone
114
+ Gitlab ::Graphql ::Loaders ::BatchModelLoader . new ( Milestone , object . milestone_id ) . find
115
+ end
116
+
117
+ def discussion_locked
118
+ !!object . discussion_locked
119
+ end
111
120
end
112
121
end
113
122
0 commit comments