Improve GraphQL documentation and cleanup API
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -68,18 +68,8 @@ export const COMMENTS_THREADS = gql`
|
||||
`;
|
||||
|
||||
export const CREATE_COMMENT_FROM_EVENT = gql`
|
||||
mutation CreateCommentFromEvent(
|
||||
$eventId: ID!
|
||||
$actorId: ID!
|
||||
$text: String!
|
||||
$inReplyToCommentId: ID
|
||||
) {
|
||||
createComment(
|
||||
eventId: $eventId
|
||||
actorId: $actorId
|
||||
text: $text
|
||||
inReplyToCommentId: $inReplyToCommentId
|
||||
) {
|
||||
mutation CreateCommentFromEvent($eventId: ID!, $text: String!, $inReplyToCommentId: ID) {
|
||||
createComment(eventId: $eventId, text: $text, inReplyToCommentId: $inReplyToCommentId) {
|
||||
...CommentRecursive
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ export const DISCUSSION_FIELDS_FRAGMENT = gql`
|
||||
`;
|
||||
|
||||
export const CREATE_DISCUSSION = gql`
|
||||
mutation createDiscussion($title: String!, $creatorId: ID!, $actorId: ID!, $text: String!) {
|
||||
createDiscussion(title: $title, text: $text, creatorId: $creatorId, actorId: $actorId) {
|
||||
mutation createDiscussion($title: String!, $actorId: ID!, $text: String!) {
|
||||
createDiscussion(title: $title, text: $text, actorId: $actorId) {
|
||||
...DiscussionFields
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,8 +498,8 @@ export const CONFIRM_PARTICIPATION = gql`
|
||||
`;
|
||||
|
||||
export const UPDATE_PARTICIPANT = gql`
|
||||
mutation AcceptParticipant($id: ID!, $moderatorActorId: ID!, $role: ParticipantRoleEnum!) {
|
||||
updateParticipation(id: $id, moderatorActorId: $moderatorActorId, role: $role) {
|
||||
mutation UpdateParticipant($id: ID!, $role: ParticipantRoleEnum!) {
|
||||
updateParticipation(id: $id, role: $role) {
|
||||
role
|
||||
id
|
||||
}
|
||||
@@ -507,20 +507,20 @@ export const UPDATE_PARTICIPANT = gql`
|
||||
`;
|
||||
|
||||
export const DELETE_EVENT = gql`
|
||||
mutation DeleteEvent($eventId: ID!, $actorId: ID!) {
|
||||
deleteEvent(eventId: $eventId, actorId: $actorId) {
|
||||
mutation DeleteEvent($eventId: ID!) {
|
||||
deleteEvent(eventId: $eventId) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
export const PARTICIPANTS = gql`
|
||||
query($uuid: UUID!, $page: Int, $limit: Int, $roles: String, $actorId: ID!) {
|
||||
query($uuid: UUID!, $page: Int, $limit: Int, $roles: String) {
|
||||
event(uuid: $uuid) {
|
||||
id,
|
||||
uuid,
|
||||
title,
|
||||
participants(page: $page, limit: $limit, roles: $roles, actorId: $actorId) {
|
||||
participants(page: $page, limit: $limit, roles: $roles) {
|
||||
${participantsQuery}
|
||||
},
|
||||
participantStats {
|
||||
|
||||
@@ -223,7 +223,6 @@ export const GET_GROUP = gql`
|
||||
|
||||
export const CREATE_GROUP = gql`
|
||||
mutation CreateGroup(
|
||||
$creatorActorId: ID!
|
||||
$preferredUsername: String!
|
||||
$name: String!
|
||||
$summary: String
|
||||
@@ -231,7 +230,6 @@ export const CREATE_GROUP = gql`
|
||||
$banner: PictureInput
|
||||
) {
|
||||
createGroup(
|
||||
creatorActorId: $creatorActorId
|
||||
preferredUsername: $preferredUsername
|
||||
name: $name
|
||||
summary: $summary
|
||||
|
||||
@@ -121,7 +121,6 @@ export const REPORT = gql`
|
||||
export const CREATE_REPORT = gql`
|
||||
mutation CreateReport(
|
||||
$eventId: ID
|
||||
$reporterId: ID!
|
||||
$reportedId: ID!
|
||||
$content: String
|
||||
$commentsIds: [ID]
|
||||
@@ -129,7 +128,6 @@ export const CREATE_REPORT = gql`
|
||||
) {
|
||||
createReport(
|
||||
eventId: $eventId
|
||||
reporterId: $reporterId
|
||||
reportedId: $reportedId
|
||||
content: $content
|
||||
commentsIds: $commentsIds
|
||||
@@ -141,8 +139,8 @@ export const CREATE_REPORT = gql`
|
||||
`;
|
||||
|
||||
export const UPDATE_REPORT = gql`
|
||||
mutation UpdateReport($reportId: ID!, $moderatorId: ID!, $status: ReportStatus!) {
|
||||
updateReportStatus(reportId: $reportId, moderatorId: $moderatorId, status: $status) {
|
||||
mutation UpdateReport($reportId: ID!, $status: ReportStatus!) {
|
||||
updateReportStatus(reportId: $reportId, status: $status) {
|
||||
...ReportFragment
|
||||
}
|
||||
}
|
||||
@@ -150,8 +148,8 @@ export const UPDATE_REPORT = gql`
|
||||
`;
|
||||
|
||||
export const CREATE_REPORT_NOTE = gql`
|
||||
mutation CreateReportNote($reportId: ID!, $moderatorId: ID!, $content: String!) {
|
||||
createReportNote(reportId: $reportId, moderatorId: $moderatorId, content: $content) {
|
||||
mutation CreateReportNote($reportId: ID!, $content: String!) {
|
||||
createReportNote(reportId: $reportId, content: $content) {
|
||||
id
|
||||
content
|
||||
insertedAt
|
||||
|
||||
@@ -2,8 +2,8 @@ import gql from "graphql-tag";
|
||||
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
export const UPLOAD_PICTURE = gql`
|
||||
mutation UploadPicture($file: Upload!, $alt: String, $name: String!, $actorId: ID!) {
|
||||
uploadPicture(file: $file, alt: $alt, name: $name, actorId: $actorId) {
|
||||
mutation UploadPicture($file: Upload!, $alt: String, $name: String!) {
|
||||
uploadPicture(file: $file, alt: $alt, name: $name) {
|
||||
url
|
||||
id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user