2020-02-18 08:57:00 +01:00
|
|
|
import gql from "graphql-tag";
|
|
|
|
|
2020-08-14 11:32:23 +02:00
|
|
|
export const MEMBER_FRAGMENT = gql`
|
|
|
|
fragment MemberFragment on Member {
|
|
|
|
id
|
|
|
|
role
|
|
|
|
parent {
|
2020-02-18 08:57:00 +01:00
|
|
|
id
|
2020-08-14 11:32:23 +02:00
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-08-14 11:32:23 +02:00
|
|
|
url
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2020-08-14 11:32:23 +02:00
|
|
|
}
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-08-14 11:32:23 +02:00
|
|
|
url
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
}
|
2020-08-14 11:32:23 +02:00
|
|
|
insertedAt
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-08-14 11:32:23 +02:00
|
|
|
export const INVITE_MEMBER = gql`
|
|
|
|
mutation InviteMember($groupId: ID!, $targetActorUsername: String!) {
|
|
|
|
inviteMember(groupId: $groupId, targetActorUsername: $targetActorUsername) {
|
|
|
|
...MemberFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${MEMBER_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
export const ACCEPT_INVITATION = gql`
|
|
|
|
mutation AcceptInvitation($id: ID!) {
|
|
|
|
acceptInvitation(id: $id) {
|
2020-08-14 11:32:23 +02:00
|
|
|
...MemberFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${MEMBER_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const REJECT_INVITATION = gql`
|
|
|
|
mutation RejectInvitation($id: ID!) {
|
|
|
|
rejectInvitation(id: $id) {
|
2020-02-18 08:57:00 +01:00
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2020-07-09 17:24:28 +02:00
|
|
|
|
|
|
|
export const GROUP_MEMBERS = gql`
|
|
|
|
query($name: String!, $roles: String, $page: Int, $limit: Int) {
|
|
|
|
group(preferredUsername: $name) {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
name
|
|
|
|
domain
|
|
|
|
preferredUsername
|
|
|
|
members(page: $page, limit: $limit, roles: $roles) {
|
|
|
|
elements {
|
2020-08-14 11:32:23 +02:00
|
|
|
id
|
2020-07-09 17:24:28 +02:00
|
|
|
role
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
name
|
|
|
|
domain
|
|
|
|
preferredUsername
|
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-07-09 17:24:28 +02:00
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
insertedAt
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2020-08-14 11:32:23 +02:00
|
|
|
|
2020-08-20 10:54:58 +02:00
|
|
|
export const UPDATE_MEMBER = gql`
|
|
|
|
mutation UpdateMember($memberId: ID!, $role: MemberRoleEnum!) {
|
|
|
|
updateMember(memberId: $memberId, role: $role) {
|
|
|
|
id
|
|
|
|
role
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-08-14 11:32:23 +02:00
|
|
|
export const REMOVE_MEMBER = gql`
|
|
|
|
mutation RemoveMember($groupId: ID!, $memberId: ID!) {
|
|
|
|
removeMember(groupId: $groupId, memberId: $memberId) {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|