2020-06-04 15:08:21 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
class ProjectMembersResolver < BaseResolver
|
2020-08-21 12:10:22 +00:00
|
|
|
include Gitlab::Graphql::Authorize::AuthorizeResource
|
|
|
|
|
2020-06-04 15:08:21 +00:00
|
|
|
argument :search, GraphQL::STRING_TYPE,
|
|
|
|
required: false,
|
|
|
|
description: 'Search query'
|
|
|
|
|
2020-08-21 12:10:22 +00:00
|
|
|
type Types::MemberInterface, null: true
|
|
|
|
|
|
|
|
authorize :read_project_member
|
2020-06-04 15:08:21 +00:00
|
|
|
|
|
|
|
alias_method :project, :object
|
|
|
|
|
|
|
|
def resolve(**args)
|
2020-08-21 12:10:22 +00:00
|
|
|
authorize!(project)
|
2020-06-04 15:08:21 +00:00
|
|
|
|
|
|
|
MembersFinder
|
2020-08-21 12:10:22 +00:00
|
|
|
.new(project, current_user, params: args)
|
2020-06-04 15:08:21 +00:00
|
|
|
.execute
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|