2020-11-05 00:09:16 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Types
|
|
|
|
class ProjectInvitationType < BaseObject
|
|
|
|
graphql_name 'ProjectInvitation'
|
|
|
|
description 'Represents a Project Membership Invitation'
|
|
|
|
|
|
|
|
expose_permissions Types::PermissionTypes::Project
|
|
|
|
|
|
|
|
implements InvitationInterface
|
|
|
|
|
2021-09-30 18:11:31 +00:00
|
|
|
authorize :admin_project
|
2020-11-05 00:09:16 +00:00
|
|
|
|
|
|
|
field :project, Types::ProjectType, null: true,
|
2021-02-05 15:09:28 +00:00
|
|
|
description: 'Project ID for the project of the invitation.'
|
2020-11-05 00:09:16 +00:00
|
|
|
|
|
|
|
def project
|
|
|
|
Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.source_id).find
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|