summaryrefslogtreecommitdiff
path: root/app/graphql/types/group_invitation_type.rb
blob: 0372ce178ff9f835533a6ebd6507ef8b222c5e89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module Types
  class GroupInvitationType < BaseObject
    expose_permissions Types::PermissionTypes::Group
    authorize :read_group

    implements InvitationInterface

    graphql_name 'GroupInvitation'
    description 'Represents a Group Invitation'

    field :group, Types::GroupType, null: true,
          description: 'Group that a User is invited to',
          resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchModelLoader.new(Group, obj.source_id).find }
  end
end