diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-05 12:09:15 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-05 12:09:15 +0000 |
commit | 20d564f1064622ef0623434372ac3ceb03173331 (patch) | |
tree | 000d95440566cd189ea774168c9756bcc8fc5fae /app/graphql/types | |
parent | 26384c9a61da9922b8fa4b8351d4e42d51661b37 (diff) | |
download | gitlab-ce-20d564f1064622ef0623434372ac3ceb03173331.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql/types')
-rw-r--r-- | app/graphql/types/group_type.rb | 4 | ||||
-rw-r--r-- | app/graphql/types/milestone_state_enum.rb | 8 | ||||
-rw-r--r-- | app/graphql/types/milestone_type.rb | 17 |
3 files changed, 26 insertions, 3 deletions
diff --git a/app/graphql/types/group_type.rb b/app/graphql/types/group_type.rb index d22983f2164..718770ebfbc 100644 --- a/app/graphql/types/group_type.rb +++ b/app/graphql/types/group_type.rb @@ -42,6 +42,10 @@ module Types field :parent, GroupType, null: true, description: 'Parent group', resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchModelLoader.new(Group, obj.parent_id).find } + + field :milestones, Types::MilestoneType.connection_type, null: true, + description: 'Find milestones', + resolver: Resolvers::MilestoneResolver end end diff --git a/app/graphql/types/milestone_state_enum.rb b/app/graphql/types/milestone_state_enum.rb new file mode 100644 index 00000000000..032571ac88f --- /dev/null +++ b/app/graphql/types/milestone_state_enum.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module Types + class MilestoneStateEnum < BaseEnum + value 'active' + value 'closed' + end +end diff --git a/app/graphql/types/milestone_type.rb b/app/graphql/types/milestone_type.rb index 9c3afb28674..900f8c6f01d 100644 --- a/app/graphql/types/milestone_type.rb +++ b/app/graphql/types/milestone_type.rb @@ -3,25 +3,36 @@ module Types class MilestoneType < BaseObject graphql_name 'Milestone' + description 'Represents a milestone.' + + present_using MilestonePresenter authorize :read_milestone field :id, GraphQL::ID_TYPE, null: false, description: 'ID of the milestone' - field :description, GraphQL::STRING_TYPE, null: true, - description: 'Description of the milestone' + field :title, GraphQL::STRING_TYPE, null: false, description: 'Title of the milestone' - field :state, GraphQL::STRING_TYPE, null: false, + + field :description, GraphQL::STRING_TYPE, null: true, + description: 'Description of the milestone' + + field :state, Types::MilestoneStateEnum, null: false, description: 'State of the milestone' + field :web_path, GraphQL::STRING_TYPE, null: false, method: :milestone_path, + description: 'Web path of the milestone' + field :due_date, Types::TimeType, null: true, description: 'Timestamp of the milestone due date' + field :start_date, Types::TimeType, null: true, description: 'Timestamp of the milestone start date' field :created_at, Types::TimeType, null: false, description: 'Timestamp of milestone creation' + field :updated_at, Types::TimeType, null: false, description: 'Timestamp of last milestone update' end |