Welcome to mirror list, hosted at ThFree Co, Russian Federation.

group_member_type.rb « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d494c55369d2dfcd83effe3ba96792a7ca8a77f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module Types
  class GroupMemberType < BaseObject
    graphql_name 'GroupMember'
    description 'Represents a Group Membership'

    expose_permissions Types::PermissionTypes::Group
    authorize :read_group

    implements MemberInterface

    field :group, Types::GroupType, null: true,
                                    description: 'Group that a user is a member of.'

    field :notification_email,
          resolver: Resolvers::GroupMembers::NotificationEmailResolver,
          description: "Group notification email for user. Only available for admins."

    def group
      Gitlab::Graphql::Loaders::BatchModelLoader.new(Group, object.source_id).find
    end
  end
end