2019-09-09 09:31:08 +02:00
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
|
|
|
export const REPORTS = gql`
|
|
|
|
query Reports($status: ReportStatus) {
|
|
|
|
reports(status: $status) {
|
|
|
|
id,
|
|
|
|
reported {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
2019-12-16 16:49:13 +01:00
|
|
|
domain,
|
2019-09-09 09:31:08 +02:00
|
|
|
name,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
},
|
|
|
|
reporter {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
avatar {
|
|
|
|
url
|
2019-12-03 11:29:51 +01:00
|
|
|
},
|
|
|
|
domain,
|
|
|
|
type
|
2019-09-09 09:31:08 +02:00
|
|
|
},
|
|
|
|
event {
|
|
|
|
id,
|
|
|
|
uuid,
|
|
|
|
title,
|
|
|
|
picture {
|
2019-10-07 16:48:13 +02:00
|
|
|
id,
|
2019-09-09 09:31:08 +02:00
|
|
|
url
|
|
|
|
}
|
|
|
|
},
|
2019-11-15 18:36:47 +01:00
|
|
|
status,
|
|
|
|
content
|
2019-09-09 09:31:08 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const REPORT_FRAGMENT = gql`
|
|
|
|
fragment ReportFragment on Report {
|
|
|
|
id,
|
|
|
|
reported {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
avatar {
|
|
|
|
url
|
2019-12-16 16:49:13 +01:00
|
|
|
},
|
|
|
|
domain
|
2019-09-09 09:31:08 +02:00
|
|
|
},
|
|
|
|
reporter {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
avatar {
|
|
|
|
url
|
2019-12-03 11:29:51 +01:00
|
|
|
},
|
|
|
|
domain,
|
|
|
|
type
|
2019-09-09 09:31:08 +02:00
|
|
|
},
|
|
|
|
event {
|
|
|
|
id,
|
|
|
|
uuid,
|
|
|
|
title,
|
|
|
|
description,
|
|
|
|
picture {
|
2019-10-07 16:48:13 +02:00
|
|
|
id,
|
2019-09-09 09:31:08 +02:00
|
|
|
url
|
|
|
|
}
|
|
|
|
},
|
2019-11-15 18:36:47 +01:00
|
|
|
comments {
|
|
|
|
id,
|
|
|
|
text,
|
|
|
|
actor {
|
|
|
|
id,
|
|
|
|
preferredUsername,
|
2019-12-16 16:49:13 +01:00
|
|
|
domain,
|
2019-11-15 18:36:47 +01:00
|
|
|
name,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-09 09:31:08 +02:00
|
|
|
notes {
|
|
|
|
id,
|
|
|
|
content
|
|
|
|
moderator {
|
2019-11-15 18:36:47 +01:00
|
|
|
id,
|
2019-09-09 09:31:08 +02:00
|
|
|
preferredUsername,
|
|
|
|
name,
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
},
|
|
|
|
insertedAt
|
|
|
|
},
|
|
|
|
insertedAt,
|
|
|
|
updatedAt,
|
|
|
|
status,
|
|
|
|
content
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const REPORT = gql`
|
|
|
|
query Report($id: ID!) {
|
|
|
|
report(id: $id) {
|
|
|
|
...ReportFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${REPORT_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_REPORT = gql`
|
|
|
|
mutation CreateReport(
|
|
|
|
$eventId: ID!,
|
2019-11-15 18:36:47 +01:00
|
|
|
$reporterId: ID!,
|
|
|
|
$reportedId: ID!,
|
|
|
|
$content: String,
|
2019-12-03 11:29:51 +01:00
|
|
|
$commentsIds: [ID],
|
|
|
|
$forward: Boolean
|
2019-09-09 09:31:08 +02:00
|
|
|
) {
|
2019-12-03 11:29:51 +01:00
|
|
|
createReport(eventId: $eventId, reporterId: $reporterId, reportedId: $reportedId, content: $content, commentsIds: $commentsIds, forward: $forward) {
|
2019-09-09 09:31:08 +02:00
|
|
|
id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const UPDATE_REPORT = gql`
|
|
|
|
mutation UpdateReport(
|
|
|
|
$reportId: ID!,
|
|
|
|
$moderatorId: ID!,
|
|
|
|
$status: ReportStatus!
|
|
|
|
) {
|
|
|
|
updateReportStatus(reportId: $reportId, moderatorId: $moderatorId, status: $status) {
|
|
|
|
...ReportFragment
|
|
|
|
}
|
|
|
|
}
|
|
|
|
${REPORT_FRAGMENT}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const CREATE_REPORT_NOTE = gql`
|
|
|
|
mutation CreateReportNote(
|
|
|
|
$reportId: ID!,
|
|
|
|
$moderatorId: ID!,
|
|
|
|
$content: String!
|
|
|
|
) {
|
|
|
|
createReportNote(reportId: $reportId, moderatorId: $moderatorId, content: $content) {
|
|
|
|
id,
|
|
|
|
content,
|
|
|
|
insertedAt
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export const LOGS = gql`
|
|
|
|
query {
|
|
|
|
actionLogs {
|
|
|
|
id,
|
|
|
|
action,
|
|
|
|
actor {
|
|
|
|
id,
|
|
|
|
preferredUsername
|
|
|
|
avatar {
|
|
|
|
url
|
|
|
|
}
|
|
|
|
},
|
|
|
|
object {
|
|
|
|
...on Report {
|
|
|
|
id
|
|
|
|
},
|
|
|
|
... on ReportNote {
|
|
|
|
report {
|
|
|
|
id,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
... on Event {
|
|
|
|
id,
|
|
|
|
title
|
|
|
|
}
|
|
|
|
},
|
|
|
|
insertedAt
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|