2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
module Types
class MilestoneType < BaseObject
graphql_name 'Milestone'
2020-11-24 15:15:51 +05:30
description 'Represents a milestone'
2020-03-13 15:44:24 +05:30
present_using MilestonePresenter
2019-02-15 15:39:39 +05:30
2019-07-07 11:18:12 +05:30
authorize :read_milestone
2020-07-28 23:09:34 +05:30
alias_method :milestone , :object
2021-10-27 15:23:28 +05:30
field :id , GraphQL :: Types :: ID , null : false ,
2021-03-11 19:13:27 +05:30
description : 'ID of the milestone.'
2020-03-13 15:44:24 +05:30
2021-10-27 15:23:28 +05:30
field :iid , GraphQL :: Types :: ID , null : false ,
2021-04-29 21:17:54 +05:30
description : " Internal ID of the milestone. "
2021-10-27 15:23:28 +05:30
field :title , GraphQL :: Types :: String , null : false ,
2021-03-11 19:13:27 +05:30
description : 'Title of the milestone.'
2020-03-13 15:44:24 +05:30
2021-10-27 15:23:28 +05:30
field :description , GraphQL :: Types :: String , null : true ,
2021-03-11 19:13:27 +05:30
description : 'Description of the milestone.'
2020-03-13 15:44:24 +05:30
field :state , Types :: MilestoneStateEnum , null : false ,
2021-03-11 19:13:27 +05:30
description : 'State of the milestone.'
2019-02-15 15:39:39 +05:30
2021-10-27 15:23:28 +05:30
field :expired , GraphQL :: Types :: Boolean , null : false ,
2021-09-30 23:02:18 +05:30
description : 'Expired state of the milestone (a milestone is expired when the due date is past the current date). Defaults to `false` when due date has not been set.'
2021-10-27 15:23:28 +05:30
field :web_path , GraphQL :: Types :: String , null : false , method : :milestone_path ,
2021-03-11 19:13:27 +05:30
description : 'Web path of the milestone.'
2020-03-13 15:44:24 +05:30
2019-12-26 22:10:19 +05:30
field :due_date , Types :: TimeType , null : true ,
2021-03-11 19:13:27 +05:30
description : 'Timestamp of the milestone due date.'
2020-03-13 15:44:24 +05:30
2019-12-26 22:10:19 +05:30
field :start_date , Types :: TimeType , null : true ,
2021-03-11 19:13:27 +05:30
description : 'Timestamp of the milestone start date.'
2019-02-15 15:39:39 +05:30
2019-12-26 22:10:19 +05:30
field :created_at , Types :: TimeType , null : false ,
2021-03-11 19:13:27 +05:30
description : 'Timestamp of milestone creation.'
2020-03-13 15:44:24 +05:30
2019-12-26 22:10:19 +05:30
field :updated_at , Types :: TimeType , null : false ,
2021-03-11 19:13:27 +05:30
description : 'Timestamp of last milestone update.'
2020-06-23 00:09:42 +05:30
2021-10-27 15:23:28 +05:30
field :project_milestone , GraphQL :: Types :: Boolean , null : false ,
2021-03-11 19:13:27 +05:30
description : 'Indicates if milestone is at project level.' ,
2020-06-23 00:09:42 +05:30
method : :project_milestone?
2021-10-27 15:23:28 +05:30
field :group_milestone , GraphQL :: Types :: Boolean , null : false ,
2021-03-11 19:13:27 +05:30
description : 'Indicates if milestone is at group level.' ,
2020-06-23 00:09:42 +05:30
method : :group_milestone?
2021-10-27 15:23:28 +05:30
field :subgroup_milestone , GraphQL :: Types :: Boolean , null : false ,
2021-03-11 19:13:27 +05:30
description : 'Indicates if milestone is at subgroup level.' ,
2020-06-23 00:09:42 +05:30
method : :subgroup_milestone?
2020-07-28 23:09:34 +05:30
field :stats , Types :: MilestoneStatsType , null : true ,
2021-03-11 19:13:27 +05:30
description : 'Milestone statistics.'
2020-07-28 23:09:34 +05:30
def stats
milestone
end
2019-02-15 15:39:39 +05:30
end
end
2020-11-24 15:15:51 +05:30
2021-06-08 01:23:25 +05:30
Types :: MilestoneType . prepend_mod_with ( 'Types::MilestoneType' )