2020-08-14 09:32:23 +00:00
|
|
|
import gql from "graphql-tag";
|
|
|
|
import { DISCUSSION_BASIC_FIELDS_FRAGMENT } from "./discussion";
|
|
|
|
import { RESOURCE_METADATA_BASIC_FIELDS_FRAGMENT } from "./resources";
|
|
|
|
import { POST_BASIC_FIELDS } from "./post";
|
|
|
|
|
|
|
|
export const LIST_GROUPS = gql`
|
2020-08-27 09:53:24 +00:00
|
|
|
query ListGroups(
|
|
|
|
$preferredUsername: String
|
|
|
|
$name: String
|
|
|
|
$domain: String
|
|
|
|
$local: Boolean
|
|
|
|
$suspended: Boolean
|
|
|
|
$page: Int
|
|
|
|
$limit: Int
|
|
|
|
) {
|
|
|
|
groups(
|
|
|
|
preferredUsername: $preferredUsername
|
|
|
|
name: $name
|
|
|
|
domain: $domain
|
|
|
|
local: $local
|
|
|
|
suspended: $suspended
|
|
|
|
page: $page
|
|
|
|
limit: $limit
|
|
|
|
) {
|
2020-08-14 09:32:23 +00:00
|
|
|
elements {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
name
|
|
|
|
domain
|
|
|
|
summary
|
|
|
|
preferredUsername
|
|
|
|
suspended
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
organizedEvents {
|
|
|
|
elements {
|
|
|
|
uuid
|
|
|
|
title
|
|
|
|
beginsOn
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-08-27 09:53:24 +00:00
|
|
|
export const GROUP_FIELDS_FRAGMENTS = gql`
|
|
|
|
fragment GroupFullFields on Group {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
name
|
|
|
|
domain
|
|
|
|
summary
|
|
|
|
preferredUsername
|
|
|
|
suspended
|
|
|
|
visibility
|
|
|
|
physicalAddress {
|
|
|
|
description
|
|
|
|
street
|
|
|
|
locality
|
|
|
|
postalCode
|
|
|
|
region
|
|
|
|
country
|
|
|
|
geom
|
|
|
|
type
|
2020-08-14 09:32:23 +00:00
|
|
|
id
|
2020-08-27 09:53:24 +00:00
|
|
|
originId
|
|
|
|
}
|
|
|
|
avatar {
|
2020-08-14 09:32:23 +00:00
|
|
|
url
|
2020-08-27 09:53:24 +00:00
|
|
|
}
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
2020-09-02 15:42:17 +00:00
|
|
|
organizedEvents(
|
|
|
|
afterDatetime: $afterDateTime
|
|
|
|
beforeDatetime: $beforeDateTime
|
|
|
|
page: $organisedEventsPage
|
|
|
|
limit: $organisedEventslimit
|
|
|
|
) {
|
2020-08-27 09:53:24 +00:00
|
|
|
elements {
|
2020-08-14 09:32:23 +00:00
|
|
|
id
|
2020-08-27 09:53:24 +00:00
|
|
|
uuid
|
|
|
|
title
|
|
|
|
beginsOn
|
2020-09-02 15:42:17 +00:00
|
|
|
options {
|
|
|
|
maximumAttendeeCapacity
|
|
|
|
}
|
|
|
|
participantStats {
|
|
|
|
participant
|
|
|
|
notApproved
|
|
|
|
}
|
|
|
|
organizerActor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
domain
|
|
|
|
}
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
total
|
|
|
|
}
|
|
|
|
discussions {
|
|
|
|
total
|
|
|
|
elements {
|
|
|
|
...DiscussionBasicFields
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
}
|
|
|
|
posts {
|
|
|
|
total
|
|
|
|
elements {
|
|
|
|
...PostBasicFields
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
}
|
|
|
|
members {
|
|
|
|
elements {
|
|
|
|
role
|
|
|
|
actor {
|
2020-08-14 09:32:23 +00:00
|
|
|
id
|
2020-08-27 09:53:24 +00:00
|
|
|
name
|
|
|
|
domain
|
|
|
|
preferredUsername
|
|
|
|
avatar {
|
|
|
|
url
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
insertedAt
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
total
|
|
|
|
}
|
|
|
|
resources(page: 1, limit: 3) {
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
resourceUrl
|
|
|
|
summary
|
|
|
|
updatedAt
|
|
|
|
type
|
|
|
|
path
|
|
|
|
metadata {
|
|
|
|
...ResourceMetadataBasicFields
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
total
|
|
|
|
}
|
|
|
|
todoLists {
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
todos {
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
status
|
|
|
|
dueDate
|
|
|
|
assignedTo {
|
2020-08-14 09:32:23 +00:00
|
|
|
id
|
2020-08-27 09:53:24 +00:00
|
|
|
preferredUsername
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
total
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
total
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const FETCH_GROUP = gql`
|
2020-09-02 15:42:17 +00:00
|
|
|
query(
|
|
|
|
$name: String!
|
|
|
|
$afterDateTime: DateTime
|
|
|
|
$beforeDateTime: DateTime
|
|
|
|
$organisedEventsPage: Int
|
|
|
|
$organisedEventslimit: Int
|
|
|
|
) {
|
2020-08-27 09:53:24 +00:00
|
|
|
group(preferredUsername: $name) {
|
|
|
|
...GroupFullFields
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${GROUP_FIELDS_FRAGMENTS}
|
|
|
|
${DISCUSSION_BASIC_FIELDS_FRAGMENT}
|
|
|
|
${POST_BASIC_FIELDS}
|
|
|
|
${RESOURCE_METADATA_BASIC_FIELDS_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const GET_GROUP = gql`
|
2020-09-02 15:42:17 +00:00
|
|
|
query(
|
|
|
|
$id: ID!
|
|
|
|
$afterDateTime: DateTime
|
|
|
|
$beforeDateTime: DateTime
|
|
|
|
$organisedEventsPage: Int
|
|
|
|
$organisedEventslimit: Int
|
|
|
|
) {
|
2020-08-27 09:53:24 +00:00
|
|
|
getGroup(id: $id) {
|
|
|
|
...GroupFullFields
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${GROUP_FIELDS_FRAGMENTS}
|
2020-08-14 09:32:23 +00:00
|
|
|
${DISCUSSION_BASIC_FIELDS_FRAGMENT}
|
|
|
|
${POST_BASIC_FIELDS}
|
|
|
|
${RESOURCE_METADATA_BASIC_FIELDS_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_GROUP = gql`
|
|
|
|
mutation CreateGroup(
|
|
|
|
$creatorActorId: ID!
|
|
|
|
$preferredUsername: String!
|
|
|
|
$name: String!
|
|
|
|
$summary: String
|
|
|
|
$avatar: PictureInput
|
|
|
|
$banner: PictureInput
|
|
|
|
) {
|
|
|
|
createGroup(
|
|
|
|
creatorActorId: $creatorActorId
|
|
|
|
preferredUsername: $preferredUsername
|
|
|
|
name: $name
|
|
|
|
summary: $summary
|
|
|
|
banner: $banner
|
|
|
|
avatar: $avatar
|
|
|
|
) {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
2020-08-27 09:53:24 +00:00
|
|
|
domain
|
2020-08-14 09:32:23 +00:00
|
|
|
summary
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const UPDATE_GROUP = gql`
|
|
|
|
mutation UpdateGroup(
|
|
|
|
$id: ID!
|
|
|
|
$name: String
|
|
|
|
$summary: String
|
|
|
|
$avatar: PictureInput
|
|
|
|
$banner: PictureInput
|
|
|
|
$visibility: GroupVisibility
|
|
|
|
$physicalAddress: AddressInput
|
|
|
|
) {
|
|
|
|
updateGroup(
|
|
|
|
id: $id
|
|
|
|
name: $name
|
|
|
|
summary: $summary
|
|
|
|
banner: $banner
|
|
|
|
avatar: $avatar
|
|
|
|
visibility: $visibility
|
|
|
|
physicalAddress: $physicalAddress
|
|
|
|
) {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
summary
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
banner {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-08-27 09:53:24 +00:00
|
|
|
export const DELETE_GROUP = gql`
|
|
|
|
mutation DeleteGroup($groupId: ID!) {
|
|
|
|
deleteGroup(groupId: $groupId) {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-08-14 09:32:23 +00:00
|
|
|
export const LEAVE_GROUP = gql`
|
|
|
|
mutation LeaveGroup($groupId: ID!) {
|
|
|
|
leaveGroup(groupId: $groupId) {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2020-08-27 09:53:24 +00:00
|
|
|
|
|
|
|
export const REFRESH_PROFILE = gql`
|
|
|
|
mutation RefreshProfile($actorId: ID!) {
|
|
|
|
refreshProfile(id: $actorId) {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|