Commit a399b0a2 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Rename milestone collection resolvers to plural

Since these return a collection of milestones, we pluralize the name.
We do this since we'll be adding another resolver for single
milestones.
parent 90c70427
# frozen_string_literal: true
module Resolvers
class GroupMilestoneResolver < MilestoneResolver
class GroupMilestonesResolver < MilestonesResolver
argument :include_descendants, GraphQL::BOOLEAN_TYPE,
required: false,
description: 'Also return milestones in all subgroups and subprojects'
......
# frozen_string_literal: true
module Resolvers
class MilestoneResolver < BaseResolver
class MilestonesResolver < BaseResolver
include Gitlab::Graphql::Authorize::AuthorizeResource
include TimeFrameArguments
......@@ -35,7 +35,7 @@ module Resolvers
end
def parent
@parent ||= object.respond_to?(:sync) ? object.sync : object
synchronized_object
end
def parent_id_parameters(args)
......
# frozen_string_literal: true
module Resolvers
class ProjectMilestoneResolver < MilestoneResolver
class ProjectMilestonesResolver < MilestonesResolver
argument :include_ancestors, GraphQL::BOOLEAN_TYPE,
required: false,
description: "Also return milestones in the project's parent group and its ancestors"
......
......@@ -51,7 +51,7 @@ module Types
field :milestones, Types::MilestoneType.connection_type, null: true,
description: 'Milestones of the group',
resolver: Resolvers::GroupMilestoneResolver
resolver: Resolvers::GroupMilestonesResolver
field :boards,
Types::BoardType.connection_type,
......
......@@ -150,7 +150,7 @@ module Types
field :milestones, Types::MilestoneType.connection_type, null: true,
description: 'Milestones of the project',
resolver: Resolvers::ProjectMilestoneResolver
resolver: Resolvers::ProjectMilestonesResolver
field :project_members,
Types::ProjectMemberType.connection_type,
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Resolvers::GroupMilestoneResolver do
RSpec.describe Resolvers::GroupMilestonesResolver do
include GraphqlHelpers
describe '#resolve' do
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Resolvers::ProjectMilestoneResolver do
RSpec.describe Resolvers::ProjectMilestonesResolver do
include GraphqlHelpers
describe '#resolve' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment