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 {
|
|
|
|
url
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2020-08-14 11:32:23 +02:00
|
|
|
}
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
|
|
|
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 {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
insertedAt
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|