2019-02-15 15:39:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Types
|
|
|
|
class MilestoneType < BaseObject
|
|
|
|
graphql_name 'Milestone'
|
2020-03-13 15:44:24 +05:30
|
|
|
description 'Represents a milestone.'
|
|
|
|
|
|
|
|
present_using MilestonePresenter
|
2019-02-15 15:39:39 +05:30
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
authorize :read_milestone
|
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
field :id, GraphQL::ID_TYPE, null: false,
|
|
|
|
description: 'ID of the milestone'
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
field :title, GraphQL::STRING_TYPE, null: false,
|
|
|
|
description: 'Title of the milestone'
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
field :description, GraphQL::STRING_TYPE, null: true,
|
|
|
|
description: 'Description of the milestone'
|
|
|
|
|
|
|
|
field :state, Types::MilestoneStateEnum, null: false,
|
2019-12-26 22:10:19 +05:30
|
|
|
description: 'State of the milestone'
|
2019-02-15 15:39:39 +05:30
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
field :web_path, GraphQL::STRING_TYPE, null: false, method: :milestone_path,
|
|
|
|
description: 'Web path of the milestone'
|
|
|
|
|
2019-12-26 22:10:19 +05:30
|
|
|
field :due_date, Types::TimeType, null: true,
|
|
|
|
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,
|
|
|
|
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,
|
|
|
|
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,
|
|
|
|
description: 'Timestamp of last milestone update'
|
2020-06-23 00:09:42 +05:30
|
|
|
|
|
|
|
field :project_milestone, GraphQL::BOOLEAN_TYPE, null: false,
|
|
|
|
description: 'Indicates if milestone is at project level',
|
|
|
|
method: :project_milestone?
|
|
|
|
|
|
|
|
field :group_milestone, GraphQL::BOOLEAN_TYPE, null: false,
|
|
|
|
description: 'Indicates if milestone is at group level',
|
|
|
|
method: :group_milestone?
|
|
|
|
|
|
|
|
field :subgroup_milestone, GraphQL::BOOLEAN_TYPE, null: false,
|
|
|
|
description: 'Indicates if milestone is at subgroup level',
|
|
|
|
method: :subgroup_milestone?
|
2019-02-15 15:39:39 +05:30
|
|
|
end
|
|
|
|
end
|