2020-02-18 07:57:00 +00:00
|
|
|
import gql from "graphql-tag";
|
|
|
|
|
2020-08-14 09:32:23 +00:00
|
|
|
export const MEMBER_FRAGMENT = gql`
|
|
|
|
fragment MemberFragment on Member {
|
|
|
|
id
|
|
|
|
role
|
|
|
|
parent {
|
2020-02-18 07:57:00 +00:00
|
|
|
id
|
2020-08-14 09:32:23 +00:00
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 14:19:26 +00:00
|
|
|
id
|
2020-08-14 09:32:23 +00:00
|
|
|
url
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 14:19:26 +00:00
|
|
|
id
|
2020-08-14 09:32:23 +00:00
|
|
|
url
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-14 09:32:23 +00:00
|
|
|
insertedAt
|
2020-02-18 07:57:00 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-08-14 09:32:23 +00:00
|
|
|
export const INVITE_MEMBER = gql`
|
|
|
|
mutation InviteMember($groupId: ID!, $targetActorUsername: String!) {
|
|
|
|
inviteMember(groupId: $groupId, targetActorUsername: $targetActorUsername) {
|
|
|
|
...MemberFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${MEMBER_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
2020-02-18 07:57:00 +00:00
|
|
|
export const ACCEPT_INVITATION = gql`
|
|
|
|
mutation AcceptInvitation($id: ID!) {
|
|
|
|
acceptInvitation(id: $id) {
|
2020-08-14 09:32:23 +00:00
|
|
|
...MemberFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${MEMBER_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const REJECT_INVITATION = gql`
|
|
|
|
mutation RejectInvitation($id: ID!) {
|
|
|
|
rejectInvitation(id: $id) {
|
2020-02-18 07:57:00 +00:00
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2020-07-09 15:24:28 +00: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 09:32:23 +00:00
|
|
|
id
|
2020-07-09 15:24:28 +00:00
|
|
|
role
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
name
|
|
|
|
domain
|
|
|
|
preferredUsername
|
|
|
|
avatar {
|
2020-10-22 14:19:26 +00:00
|
|
|
id
|
2020-07-09 15:24:28 +00:00
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
insertedAt
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2020-08-14 09:32:23 +00:00
|
|
|
|
2020-08-20 08:54:58 +00:00
|
|
|
export const UPDATE_MEMBER = gql`
|
|
|
|
mutation UpdateMember($memberId: ID!, $role: MemberRoleEnum!) {
|
|
|
|
updateMember(memberId: $memberId, role: $role) {
|
|
|
|
id
|
|
|
|
role
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-08-14 09:32:23 +00:00
|
|
|
export const REMOVE_MEMBER = gql`
|
|
|
|
mutation RemoveMember($groupId: ID!, $memberId: ID!) {
|
|
|
|
removeMember(groupId: $groupId, memberId: $memberId) {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2020-11-06 10:34:32 +00:00
|
|
|
|
|
|
|
export const JOIN_GROUP = gql`
|
|
|
|
mutation JoinGroup($groupId: ID!) {
|
|
|
|
joinGroup(groupId: $groupId) {
|
|
|
|
...MemberFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${MEMBER_FRAGMENT}
|
|
|
|
`;
|