2020-09-14 15:09:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
class MembersResolver < BaseResolver
|
|
|
|
include Gitlab::Graphql::Authorize::AuthorizeResource
|
|
|
|
include LooksAhead
|
|
|
|
|
2020-11-17 12:09:15 +00:00
|
|
|
type Types::MemberInterface.connection_type, null: true
|
|
|
|
|
2020-09-14 15:09:28 +00:00
|
|
|
argument :search, GraphQL::STRING_TYPE,
|
|
|
|
required: false,
|
|
|
|
description: 'Search query'
|
|
|
|
|
|
|
|
def resolve_with_lookahead(**args)
|
|
|
|
authorize!(object)
|
|
|
|
|
|
|
|
apply_lookahead(finder_class.new(object, current_user, params: args).execute)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def finder_class
|
|
|
|
# override in subclass
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|