2020-02-18 08:57:00 +01:00
|
|
|
import gql from "graphql-tag";
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
export const REPORTS = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
query Reports($status: ReportStatus) {
|
|
|
|
reports(status: $status) {
|
|
|
|
id
|
|
|
|
reported {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-02-18 08:57:00 +01:00
|
|
|
url
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
reporter {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-02-18 08:57:00 +01:00
|
|
|
url
|
|
|
|
}
|
|
|
|
domain
|
|
|
|
type
|
|
|
|
}
|
|
|
|
event {
|
|
|
|
id
|
|
|
|
uuid
|
|
|
|
title
|
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
status
|
|
|
|
content
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-09-09 09:31:08 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
const REPORT_FRAGMENT = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
fragment ReportFragment on Report {
|
|
|
|
id
|
|
|
|
reported {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-02-18 08:57:00 +01:00
|
|
|
url
|
|
|
|
}
|
|
|
|
domain
|
|
|
|
}
|
|
|
|
reporter {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-02-18 08:57:00 +01:00
|
|
|
url
|
|
|
|
}
|
|
|
|
domain
|
|
|
|
type
|
|
|
|
}
|
|
|
|
event {
|
|
|
|
id
|
|
|
|
uuid
|
|
|
|
title
|
|
|
|
description
|
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
comments {
|
|
|
|
id
|
|
|
|
text
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-02-18 08:57:00 +01:00
|
|
|
url
|
2019-11-15 18:36:47 +01:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
notes {
|
|
|
|
id
|
|
|
|
content
|
|
|
|
moderator {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-02-18 08:57:00 +01:00
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
insertedAt
|
|
|
|
}
|
|
|
|
insertedAt
|
|
|
|
updatedAt
|
|
|
|
status
|
|
|
|
content
|
|
|
|
}
|
2019-09-09 09:31:08 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const REPORT = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
query Report($id: ID!) {
|
|
|
|
report(id: $id) {
|
|
|
|
...ReportFragment
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${REPORT_FRAGMENT}
|
2019-09-09 09:31:08 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_REPORT = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
mutation CreateReport(
|
2020-09-30 15:25:30 +02:00
|
|
|
$eventId: ID
|
2020-02-18 08:57:00 +01:00
|
|
|
$reportedId: ID!
|
|
|
|
$content: String
|
|
|
|
$commentsIds: [ID]
|
|
|
|
$forward: Boolean
|
|
|
|
) {
|
|
|
|
createReport(
|
|
|
|
eventId: $eventId
|
|
|
|
reportedId: $reportedId
|
|
|
|
content: $content
|
|
|
|
commentsIds: $commentsIds
|
|
|
|
forward: $forward
|
2019-09-09 09:31:08 +02:00
|
|
|
) {
|
2020-02-18 08:57:00 +01:00
|
|
|
id
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
`;
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
export const UPDATE_REPORT = gql`
|
2020-11-19 17:06:28 +01:00
|
|
|
mutation UpdateReport($reportId: ID!, $status: ReportStatus!) {
|
|
|
|
updateReportStatus(reportId: $reportId, status: $status) {
|
2020-02-18 08:57:00 +01:00
|
|
|
...ReportFragment
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
${REPORT_FRAGMENT}
|
2019-09-09 09:31:08 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_REPORT_NOTE = gql`
|
2020-11-19 17:06:28 +01:00
|
|
|
mutation CreateReportNote($reportId: ID!, $content: String!) {
|
|
|
|
createReportNote(reportId: $reportId, content: $content) {
|
2020-02-18 08:57:00 +01:00
|
|
|
id
|
|
|
|
content
|
|
|
|
insertedAt
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
`;
|
2019-09-09 09:31:08 +02:00
|
|
|
|
|
|
|
export const LOGS = gql`
|
2020-02-18 08:57:00 +01:00
|
|
|
query {
|
|
|
|
actionLogs {
|
|
|
|
id
|
|
|
|
action
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
2020-10-21 12:14:53 +02:00
|
|
|
domain
|
2020-02-18 08:57:00 +01:00
|
|
|
avatar {
|
2020-10-22 16:19:26 +02:00
|
|
|
id
|
2020-02-18 08:57:00 +01:00
|
|
|
url
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
object {
|
|
|
|
... on Report {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
... on ReportNote {
|
|
|
|
report {
|
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
... on Event {
|
|
|
|
id
|
|
|
|
title
|
|
|
|
}
|
2020-06-11 19:13:21 +02:00
|
|
|
... on Person {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
}
|
2020-06-15 19:41:11 +02:00
|
|
|
... on User {
|
|
|
|
id
|
|
|
|
email
|
|
|
|
confirmedAt
|
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
insertedAt
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
`;
|