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 {
|
|
|
|
url
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
reporter {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
avatar {
|
|
|
|
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 {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
domain
|
|
|
|
}
|
|
|
|
reporter {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
name
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
domain
|
|
|
|
type
|
|
|
|
}
|
|
|
|
event {
|
|
|
|
id
|
|
|
|
uuid
|
|
|
|
title
|
|
|
|
description
|
|
|
|
picture {
|
|
|
|
id
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
comments {
|
|
|
|
id
|
|
|
|
text
|
|
|
|
actor {
|
|
|
|
id
|
|
|
|
preferredUsername
|
|
|
|
domain
|
|
|
|
name
|
|
|
|
avatar {
|
|
|
|
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 {
|
|
|
|
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(
|
|
|
|
$eventId: ID!
|
|
|
|
$reporterId: ID!
|
|
|
|
$reportedId: ID!
|
|
|
|
$content: String
|
|
|
|
$commentsIds: [ID]
|
|
|
|
$forward: Boolean
|
|
|
|
) {
|
|
|
|
createReport(
|
|
|
|
eventId: $eventId
|
|
|
|
reporterId: $reporterId
|
|
|
|
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-02-18 08:57:00 +01:00
|
|
|
mutation UpdateReport($reportId: ID!, $moderatorId: ID!, $status: ReportStatus!) {
|
|
|
|
updateReportStatus(reportId: $reportId, moderatorId: $moderatorId, status: $status) {
|
|
|
|
...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-02-18 08:57:00 +01:00
|
|
|
mutation CreateReportNote($reportId: ID!, $moderatorId: ID!, $content: String!) {
|
|
|
|
createReportNote(reportId: $reportId, moderatorId: $moderatorId, content: $content) {
|
|
|
|
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
|
|
|
|
avatar {
|
|
|
|
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-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
insertedAt
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
2020-02-18 08:57:00 +01:00
|
|
|
}
|
|
|
|
`;
|