2020-02-18 08:57:00 +01:00
|
|
|
import gql from "graphql-tag";
|
2021-10-29 10:54:35 +02:00
|
|
|
import { ACTOR_FRAGMENT } from "./actor";
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
export const DASHBOARD = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
query {
|
|
|
|
dashboard {
|
|
|
|
lastPublicEventPublished {
|
2020-10-15 11:04:05 +02:00
|
|
|
id
|
2020-02-18 08:57:00 +01:00
|
|
|
uuid
|
|
|
|
title
|
|
|
|
picture {
|
|
|
|
id
|
|
|
|
alt
|
|
|
|
url
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2020-10-15 11:04:05 +02:00
|
|
|
lastGroupCreated {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2020-10-15 11:04:05 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
numberOfUsers
|
|
|
|
numberOfEvents
|
|
|
|
numberOfComments
|
|
|
|
numberOfReports
|
2020-10-15 11:04:05 +02:00
|
|
|
numberOfGroups
|
|
|
|
numberOfFollowers
|
|
|
|
numberOfFollowings
|
|
|
|
numberOfConfirmedParticipationsToLocalEvents
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2021-10-29 10:54:35 +02:00
|
|
|
${ACTOR_FRAGMENT}
|
2020-02-18 08:57:00 +01:00
|
|
|
`;
|
2019-12-03 11:29:51 +01:00
|
|
|
|
|
|
|
export const RELAY_FRAGMENT = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
fragment relayFragment on Follower {
|
2021-05-12 18:10:07 +02:00
|
|
|
id
|
2020-02-18 08:57:00 +01:00
|
|
|
actor {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
targetActor {
|
2021-10-29 10:54:35 +02:00
|
|
|
...ActorFragment
|
2019-12-03 11:29:51 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
approved
|
|
|
|
insertedAt
|
|
|
|
updatedAt
|
|
|
|
}
|
2021-10-29 10:54:35 +02:00
|
|
|
${ACTOR_FRAGMENT}
|
2019-12-03 11:29:51 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const RELAY_FOLLOWERS = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
query relayFollowers($page: Int, $limit: Int) {
|
|
|
|
relayFollowers(page: $page, limit: $limit) {
|
|
|
|
elements {
|
|
|
|
...relayFragment
|
|
|
|
}
|
|
|
|
total
|
2019-12-03 11:29:51 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${RELAY_FRAGMENT}
|
2019-12-03 11:29:51 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const RELAY_FOLLOWINGS = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
query relayFollowings($page: Int, $limit: Int) {
|
|
|
|
relayFollowings(page: $page, limit: $limit) {
|
|
|
|
elements {
|
|
|
|
...relayFragment
|
|
|
|
}
|
|
|
|
total
|
2019-12-03 11:29:51 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${RELAY_FRAGMENT}
|
2019-12-03 11:29:51 +01:00
|
|
|
`;
|
|
|
|
|
2021-12-28 11:42:08 +01:00
|
|
|
export const INSTANCE_FRAGMENT = gql`
|
|
|
|
fragment InstanceFragment on Instance {
|
|
|
|
domain
|
|
|
|
hasRelay
|
2022-05-06 17:21:11 +02:00
|
|
|
relayAddress
|
2021-12-28 11:42:08 +01:00
|
|
|
followerStatus
|
|
|
|
followedStatus
|
|
|
|
eventCount
|
|
|
|
personCount
|
|
|
|
groupCount
|
|
|
|
followersCount
|
|
|
|
followingsCount
|
|
|
|
reportsCount
|
|
|
|
mediaSize
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const INSTANCE = gql`
|
|
|
|
query instance($domain: ID!) {
|
|
|
|
instance(domain: $domain) {
|
|
|
|
...InstanceFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${INSTANCE_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const INSTANCES = gql`
|
|
|
|
query Instances(
|
|
|
|
$page: Int
|
|
|
|
$limit: Int
|
|
|
|
$orderBy: InstancesSortFields
|
|
|
|
$direction: String
|
|
|
|
$filterDomain: String
|
|
|
|
$filterFollowStatus: InstanceFilterFollowStatus
|
|
|
|
$filterSuspendStatus: InstanceFilterSuspendStatus
|
|
|
|
) {
|
|
|
|
instances(
|
|
|
|
page: $page
|
|
|
|
limit: $limit
|
|
|
|
orderBy: $orderBy
|
|
|
|
direction: $direction
|
|
|
|
filterDomain: $filterDomain
|
|
|
|
filterFollowStatus: $filterFollowStatus
|
|
|
|
filterSuspendStatus: $filterSuspendStatus
|
|
|
|
) {
|
|
|
|
total
|
|
|
|
elements {
|
|
|
|
...InstanceFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${INSTANCE_FRAGMENT}
|
|
|
|
`;
|
|
|
|
export const ADD_INSTANCE = gql`
|
|
|
|
mutation addInstance($domain: String!) {
|
|
|
|
addInstance(domain: $domain) {
|
|
|
|
...InstanceFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${INSTANCE_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
2019-12-03 11:29:51 +01:00
|
|
|
export const REMOVE_RELAY = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
mutation removeRelay($address: String!) {
|
|
|
|
removeRelay(address: $address) {
|
|
|
|
...relayFragment
|
2019-12-03 11:29:51 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${RELAY_FRAGMENT}
|
2019-12-03 11:29:51 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const ACCEPT_RELAY = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
mutation acceptRelay($address: String!) {
|
|
|
|
acceptRelay(address: $address) {
|
|
|
|
...relayFragment
|
2019-12-03 11:29:51 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${RELAY_FRAGMENT}
|
2019-12-03 11:29:51 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const REJECT_RELAY = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
mutation rejectRelay($address: String!) {
|
|
|
|
rejectRelay(address: $address) {
|
|
|
|
...relayFragment
|
2019-12-03 11:29:51 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${RELAY_FRAGMENT}
|
2019-12-03 11:29:51 +01:00
|
|
|
`;
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2020-10-07 15:37:23 +02:00
|
|
|
export const LANGUAGES = gql`
|
|
|
|
query {
|
|
|
|
languages {
|
|
|
|
code
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2020-11-02 11:22:54 +01:00
|
|
|
export const LANGUAGES_CODES = gql`
|
|
|
|
query LanguagesCodes($codes: [String!]) {
|
|
|
|
languages(codes: $codes) {
|
|
|
|
code
|
|
|
|
name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-12-20 13:04:34 +01:00
|
|
|
export const ADMIN_SETTINGS_FRAGMENT = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
fragment adminSettingsFragment on AdminSettings {
|
|
|
|
instanceName
|
|
|
|
instanceDescription
|
2020-06-19 19:27:10 +02:00
|
|
|
instanceLongDescription
|
2020-10-21 17:49:18 +02:00
|
|
|
instanceSlogan
|
2020-06-19 19:27:10 +02:00
|
|
|
contact
|
2020-02-18 08:57:00 +01:00
|
|
|
instanceTerms
|
|
|
|
instanceTermsType
|
|
|
|
instanceTermsUrl
|
2020-06-19 19:27:10 +02:00
|
|
|
instancePrivacyPolicy
|
|
|
|
instancePrivacyPolicyType
|
|
|
|
instancePrivacyPolicyUrl
|
2020-06-15 11:01:49 +02:00
|
|
|
instanceRules
|
2020-02-18 08:57:00 +01:00
|
|
|
registrationsOpen
|
2020-10-07 15:37:23 +02:00
|
|
|
instanceLanguages
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-12-20 13:04:34 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const ADMIN_SETTINGS = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
query {
|
|
|
|
adminSettings {
|
|
|
|
...adminSettingsFragment
|
2019-12-20 13:04:34 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${ADMIN_SETTINGS_FRAGMENT}
|
2019-12-20 13:04:34 +01:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const SAVE_ADMIN_SETTINGS = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
mutation SaveAdminSettings(
|
|
|
|
$instanceName: String
|
|
|
|
$instanceDescription: String
|
2020-06-19 19:27:10 +02:00
|
|
|
$instanceLongDescription: String
|
2020-10-21 17:49:18 +02:00
|
|
|
$instanceSlogan: String
|
2020-06-19 19:27:10 +02:00
|
|
|
$contact: String
|
2020-02-18 08:57:00 +01:00
|
|
|
$instanceTerms: String
|
|
|
|
$instanceTermsType: InstanceTermsType
|
|
|
|
$instanceTermsUrl: String
|
2020-06-19 19:27:10 +02:00
|
|
|
$instancePrivacyPolicy: String
|
|
|
|
$instancePrivacyPolicyType: InstancePrivacyType
|
|
|
|
$instancePrivacyPolicyUrl: String
|
2020-06-15 11:01:49 +02:00
|
|
|
$instanceRules: String
|
2020-02-18 08:57:00 +01:00
|
|
|
$registrationsOpen: Boolean
|
2020-10-07 15:37:23 +02:00
|
|
|
$instanceLanguages: [String]
|
2020-02-18 08:57:00 +01:00
|
|
|
) {
|
|
|
|
saveAdminSettings(
|
|
|
|
instanceName: $instanceName
|
|
|
|
instanceDescription: $instanceDescription
|
2020-06-19 19:27:10 +02:00
|
|
|
instanceLongDescription: $instanceLongDescription
|
2020-10-21 17:49:18 +02:00
|
|
|
instanceSlogan: $instanceSlogan
|
2020-06-19 19:27:10 +02:00
|
|
|
contact: $contact
|
2020-02-18 08:57:00 +01:00
|
|
|
instanceTerms: $instanceTerms
|
|
|
|
instanceTermsType: $instanceTermsType
|
|
|
|
instanceTermsUrl: $instanceTermsUrl
|
2020-06-19 19:27:10 +02:00
|
|
|
instancePrivacyPolicy: $instancePrivacyPolicy
|
|
|
|
instancePrivacyPolicyType: $instancePrivacyPolicyType
|
|
|
|
instancePrivacyPolicyUrl: $instancePrivacyPolicyUrl
|
2020-06-15 11:01:49 +02:00
|
|
|
instanceRules: $instanceRules
|
2020-02-18 08:57:00 +01:00
|
|
|
registrationsOpen: $registrationsOpen
|
2020-10-07 15:37:23 +02:00
|
|
|
instanceLanguages: $instanceLanguages
|
2020-02-18 08:57:00 +01:00
|
|
|
) {
|
|
|
|
...adminSettingsFragment
|
2019-12-20 13:04:34 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${ADMIN_SETTINGS_FRAGMENT}
|
2019-12-20 13:04:34 +01:00
|
|
|
`;
|
2022-01-14 18:10:50 +01:00
|
|
|
|
|
|
|
export const ADMIN_UPDATE_USER = gql`
|
|
|
|
mutation AdminUpdateUser(
|
|
|
|
$id: ID!
|
|
|
|
$email: String
|
|
|
|
$role: UserRole
|
|
|
|
$confirmed: Boolean
|
|
|
|
$notify: Boolean
|
|
|
|
) {
|
|
|
|
adminUpdateUser(
|
|
|
|
id: $id
|
|
|
|
email: $email
|
|
|
|
role: $role
|
|
|
|
confirmed: $confirmed
|
|
|
|
notify: $notify
|
|
|
|
) {
|
|
|
|
id
|
|
|
|
email
|
|
|
|
role
|
|
|
|
confirmedAt
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|