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";
|
2021-10-29 08:54:35 +00:00
|
|
|
import { ACTOR_FRAGMENT } from "./actor";
|
2020-08-14 09:32:23 +00:00
|
|
|
|
|
|
|
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 {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2020-08-14 09:32:23 +00:00
|
|
|
suspended
|
|
|
|
avatar {
|
2020-10-22 14:19:26 +00:00
|
|
|
id
|
2020-08-14 09:32:23 +00:00
|
|
|
url
|
|
|
|
}
|
|
|
|
banner {
|
2020-10-22 14:19:26 +00:00
|
|
|
id
|
2020-08-14 09:32:23 +00:00
|
|
|
url
|
|
|
|
}
|
|
|
|
organizedEvents {
|
|
|
|
elements {
|
2020-10-21 10:14:53 +00:00
|
|
|
id
|
2020-08-14 09:32:23 +00:00
|
|
|
uuid
|
|
|
|
title
|
|
|
|
beginsOn
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
}
|
|
|
|
total
|
|
|
|
}
|
|
|
|
}
|
2021-10-29 08:54:35 +00:00
|
|
|
${ACTOR_FRAGMENT}
|
2020-08-14 09:32:23 +00:00
|
|
|
`;
|
|
|
|
|
2020-08-27 09:53:24 +00:00
|
|
|
export const GROUP_FIELDS_FRAGMENTS = gql`
|
|
|
|
fragment GroupFullFields on Group {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2020-08-27 09:53:24 +00:00
|
|
|
suspended
|
|
|
|
visibility
|
2020-11-06 10:34:32 +00:00
|
|
|
openness
|
2021-01-20 17:16:44 +00:00
|
|
|
manuallyApprovesFollowers
|
2020-08-27 09:53:24 +00:00
|
|
|
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-10-22 14:19:26 +00:00
|
|
|
id
|
2020-08-14 09:32:23 +00:00
|
|
|
url
|
2021-06-15 15:25:33 +00:00
|
|
|
name
|
|
|
|
metadata {
|
|
|
|
width
|
|
|
|
height
|
|
|
|
blurhash
|
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
}
|
|
|
|
banner {
|
2020-10-22 14:19:26 +00:00
|
|
|
id
|
2020-08-27 09:53:24 +00:00
|
|
|
url
|
2021-06-15 15:25:33 +00:00
|
|
|
name
|
|
|
|
metadata {
|
|
|
|
width
|
|
|
|
height
|
|
|
|
blurhash
|
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
}
|
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-12-01 08:55:24 +00:00
|
|
|
draft
|
2020-09-02 15:42:17 +00:00
|
|
|
options {
|
|
|
|
maximumAttendeeCapacity
|
|
|
|
}
|
|
|
|
participantStats {
|
|
|
|
participant
|
|
|
|
notApproved
|
|
|
|
}
|
2020-10-01 13:57:07 +00:00
|
|
|
attributedTo {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2020-10-01 13:57:07 +00:00
|
|
|
}
|
2020-09-02 15:42:17 +00:00
|
|
|
organizerActor {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2020-09-02 15:42:17 +00:00
|
|
|
}
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
total
|
|
|
|
}
|
2021-05-20 14:51:41 +00:00
|
|
|
discussions(page: $discussionsPage, limit: $discussionsLimit) {
|
2020-08-27 09:53:24 +00:00
|
|
|
total
|
|
|
|
elements {
|
|
|
|
...DiscussionBasicFields
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
}
|
2021-05-12 16:10:07 +00:00
|
|
|
posts(page: $postsPage, limit: $postsLimit) {
|
2020-08-27 09:53:24 +00:00
|
|
|
total
|
|
|
|
elements {
|
|
|
|
...PostBasicFields
|
2020-08-14 09:32:23 +00:00
|
|
|
}
|
2020-08-27 09:53:24 +00:00
|
|
|
}
|
2021-05-12 16:10:07 +00:00
|
|
|
members(page: $membersPage, limit: $membersLimit) {
|
2020-08-27 09:53:24 +00:00
|
|
|
elements {
|
2020-10-15 12:23:55 +00:00
|
|
|
id
|
2020-08-27 09:53:24 +00:00
|
|
|
role
|
|
|
|
actor {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
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
|
|
|
}
|
|
|
|
}
|
2021-10-29 08:54:35 +00:00
|
|
|
${ACTOR_FRAGMENT}
|
2020-08-27 09:53:24 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const FETCH_GROUP = gql`
|
2021-06-11 13:07:19 +00:00
|
|
|
query FetchGroup(
|
2020-09-02 15:42:17 +00:00
|
|
|
$name: String!
|
|
|
|
$afterDateTime: DateTime
|
|
|
|
$beforeDateTime: DateTime
|
|
|
|
$organisedEventsPage: Int
|
|
|
|
$organisedEventslimit: Int
|
2021-05-20 08:15:09 +00:00
|
|
|
$postsPage: Int
|
|
|
|
$postsLimit: Int
|
|
|
|
$membersPage: Int
|
|
|
|
$membersLimit: Int
|
2021-05-20 14:51:41 +00:00
|
|
|
$discussionsPage: Int
|
|
|
|
$discussionsLimit: Int
|
2020-09-02 15:42:17 +00:00
|
|
|
) {
|
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`
|
2021-06-11 13:07:19 +00:00
|
|
|
query GetGroup(
|
2020-09-02 15:42:17 +00:00
|
|
|
$id: ID!
|
|
|
|
$afterDateTime: DateTime
|
|
|
|
$beforeDateTime: DateTime
|
|
|
|
$organisedEventsPage: Int
|
|
|
|
$organisedEventslimit: Int
|
2021-05-12 16:10:07 +00:00
|
|
|
$postsPage: Int
|
|
|
|
$postsLimit: Int
|
|
|
|
$membersPage: Int
|
|
|
|
$membersLimit: Int
|
2021-05-20 14:51:41 +00:00
|
|
|
$discussionsPage: Int
|
|
|
|
$discussionsLimit: Int
|
2020-09-02 15:42:17 +00:00
|
|
|
) {
|
2020-08-27 09:53:24 +00:00
|
|
|
getGroup(id: $id) {
|
2020-12-01 08:56:14 +00:00
|
|
|
mediaSize
|
2020-08-27 09:53:24 +00:00
|
|
|
...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(
|
|
|
|
$preferredUsername: String!
|
|
|
|
$name: String!
|
|
|
|
$summary: String
|
2020-11-26 10:41:13 +00:00
|
|
|
$avatar: MediaInput
|
|
|
|
$banner: MediaInput
|
2020-08-14 09:32:23 +00:00
|
|
|
) {
|
|
|
|
createGroup(
|
|
|
|
preferredUsername: $preferredUsername
|
|
|
|
name: $name
|
|
|
|
summary: $summary
|
|
|
|
banner: $banner
|
|
|
|
avatar: $avatar
|
|
|
|
) {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2020-08-14 09:32:23 +00:00
|
|
|
banner {
|
2020-10-22 14:19:26 +00:00
|
|
|
id
|
2020-08-14 09:32:23 +00:00
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-29 08:54:35 +00:00
|
|
|
${ACTOR_FRAGMENT}
|
2020-08-14 09:32:23 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const UPDATE_GROUP = gql`
|
|
|
|
mutation UpdateGroup(
|
|
|
|
$id: ID!
|
|
|
|
$name: String
|
|
|
|
$summary: String
|
2020-11-26 10:41:13 +00:00
|
|
|
$avatar: MediaInput
|
|
|
|
$banner: MediaInput
|
2020-08-14 09:32:23 +00:00
|
|
|
$visibility: GroupVisibility
|
2020-11-06 10:34:32 +00:00
|
|
|
$openness: Openness
|
2020-08-14 09:32:23 +00:00
|
|
|
$physicalAddress: AddressInput
|
2021-01-20 17:16:44 +00:00
|
|
|
$manuallyApprovesFollowers: Boolean
|
2020-08-14 09:32:23 +00:00
|
|
|
) {
|
|
|
|
updateGroup(
|
|
|
|
id: $id
|
|
|
|
name: $name
|
|
|
|
summary: $summary
|
|
|
|
banner: $banner
|
|
|
|
avatar: $avatar
|
|
|
|
visibility: $visibility
|
2020-11-06 10:34:32 +00:00
|
|
|
openness: $openness
|
2020-08-14 09:32:23 +00:00
|
|
|
physicalAddress: $physicalAddress
|
2021-01-20 17:16:44 +00:00
|
|
|
manuallyApprovesFollowers: $manuallyApprovesFollowers
|
2020-08-14 09:32:23 +00:00
|
|
|
) {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2020-11-06 10:34:32 +00:00
|
|
|
visibility
|
|
|
|
openness
|
2021-01-20 17:16:44 +00:00
|
|
|
manuallyApprovesFollowers
|
2020-08-14 09:32:23 +00:00
|
|
|
banner {
|
2020-10-22 14:19:26 +00:00
|
|
|
id
|
2020-08-14 09:32:23 +00:00
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-29 08:54:35 +00:00
|
|
|
${ACTOR_FRAGMENT}
|
2020-08-14 09:32:23 +00:00
|
|
|
`;
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
2021-02-24 18:06:48 +00:00
|
|
|
|
|
|
|
export const GROUP_TIMELINE = gql`
|
|
|
|
query GroupTimeline(
|
|
|
|
$preferredUsername: String!
|
|
|
|
$type: ActivityType
|
2021-03-09 15:20:58 +00:00
|
|
|
$author: ActivityAuthor
|
2021-02-24 18:06:48 +00:00
|
|
|
$page: Int
|
|
|
|
$limit: Int
|
|
|
|
) {
|
|
|
|
group(preferredUsername: $preferredUsername) {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2021-03-09 15:20:58 +00:00
|
|
|
activity(type: $type, author: $author, page: $page, limit: $limit) {
|
2021-02-24 18:06:48 +00:00
|
|
|
total
|
|
|
|
elements {
|
|
|
|
id
|
|
|
|
insertedAt
|
|
|
|
subject
|
|
|
|
subjectParams {
|
|
|
|
key
|
|
|
|
value
|
|
|
|
}
|
|
|
|
type
|
|
|
|
author {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2021-02-24 18:06:48 +00:00
|
|
|
}
|
|
|
|
group {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2021-02-24 18:06:48 +00:00
|
|
|
}
|
|
|
|
object {
|
|
|
|
... on Event {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
}
|
|
|
|
... on Post {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
}
|
|
|
|
... on Member {
|
|
|
|
id
|
|
|
|
actor {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2021-02-24 18:06:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
... on Resource {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
path
|
|
|
|
type
|
|
|
|
}
|
|
|
|
... on Discussion {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
slug
|
|
|
|
}
|
2021-03-10 16:38:13 +00:00
|
|
|
... on Comment {
|
|
|
|
id
|
|
|
|
}
|
2021-02-24 18:06:48 +00:00
|
|
|
... on Group {
|
2021-10-29 08:54:35 +00:00
|
|
|
...ActorFragment
|
2021-02-24 18:06:48 +00:00
|
|
|
visibility
|
|
|
|
openness
|
|
|
|
physicalAddress {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
banner {
|
|
|
|
id
|
2021-10-29 08:54:35 +00:00
|
|
|
url
|
2021-02-24 18:06:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-29 08:54:35 +00:00
|
|
|
${ACTOR_FRAGMENT}
|
2021-02-24 18:06:48 +00:00
|
|
|
`;
|