From 1488862c7700eca7b1b8079ac3d575992efff5ed Mon Sep 17 00:00:00 2001
From: Mike Kalange <countablecloud@gmail.com>
Date: Wed, 26 Mar 2025 13:19:57 -0700
Subject: [PATCH] WIP: Comment CRUD

---
 src/index.tsx  | 31 +++++++++++++++++++++++++++++++
 src/schema.gql | 17 +++++++++++++++++
 2 files changed, 48 insertions(+)

diff --git a/src/index.tsx b/src/index.tsx
index 8e90715..8bae20e 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -122,6 +122,16 @@ export enum ClientUploadStatusEnum {
   UploadEnabled = "UPLOAD_ENABLED",
 }
 
+export type CommentGql = {
+  __typename?: "CommentGQL";
+  createdAt?: Maybe<Scalars["DateTime"]["output"]>;
+  id: Scalars["Int"]["output"];
+  message: Scalars["String"]["output"];
+  replies: Array<CommentGql>;
+  updatedAt?: Maybe<Scalars["DateTime"]["output"]>;
+  user: UserGql;
+};
+
 export type CountLeaderboardGql = {
   __typename?: "CountLeaderboardGQL";
   entries: Array<UserShotCountEntry>;
@@ -2141,10 +2151,13 @@ export type MustHaveSetForUploadLinkErrSegmentAlreadyUploadedErrProcessingFailed
 export type Mutation = {
   __typename?: "Mutation";
   addAnnotationToShot: AddShotAnnotationReturn;
+  commentOnVideo: Scalars["Boolean"]["output"];
   createBucketSet: BucketSetGql;
   createUploadStream: CreateUploadStreamReturn;
+  deleteComment: Scalars["Boolean"]["output"];
   deleteTags: Scalars["Boolean"]["output"];
   deleteVideo: Scalars["Boolean"]["output"];
+  editComment: Scalars["Boolean"]["output"];
   editProfileImageUri: UserGql;
   editShot: EditShotReturn;
   editUploadStream: Scalars["Boolean"]["output"];
@@ -2167,6 +2180,12 @@ export type MutationAddAnnotationToShotArgs = {
   shotId: Scalars["Int"]["input"];
 };
 
+export type MutationCommentOnVideoArgs = {
+  message: Scalars["String"]["input"];
+  parentCommentId?: InputMaybe<Scalars["Int"]["input"]>;
+  videoId: Scalars["Int"]["input"];
+};
+
 export type MutationCreateBucketSetArgs = {
   params: CreateBucketSetInput;
 };
@@ -2175,6 +2194,11 @@ export type MutationCreateUploadStreamArgs = {
   videoMetadata: VideoMetadataInput;
 };
 
+export type MutationDeleteCommentArgs = {
+  commentId: Scalars["Int"]["input"];
+  videoId: Scalars["Int"]["input"];
+};
+
 export type MutationDeleteTagsArgs = {
   tagsToDelete: Array<VideoTagInput>;
   videoId: Scalars["Int"]["input"];
@@ -2184,6 +2208,12 @@ export type MutationDeleteVideoArgs = {
   videoId: Scalars["Int"]["input"];
 };
 
+export type MutationEditCommentArgs = {
+  commentId: Scalars["Int"]["input"];
+  newMessage: Scalars["String"]["input"];
+  videoId: Scalars["Int"]["input"];
+};
+
 export type MutationEditProfileImageUriArgs = {
   profileImageUri: Scalars["String"]["input"];
 };
@@ -2901,6 +2931,7 @@ export type VideoGql = {
   __typename?: "VideoGQL";
   averageDifficulty?: Maybe<Scalars["Float"]["output"]>;
   averageTimeBetweenShots?: Maybe<Scalars["Float"]["output"]>;
+  comments: Array<CommentGql>;
   createdAt?: Maybe<Scalars["DateTime"]["output"]>;
   currentHomography?: Maybe<HomographyInfoGql>;
   currentProcessing?: Maybe<VideoProcessingGql>;
diff --git a/src/schema.gql b/src/schema.gql
index 5e47c9d..c2070f3 100644
--- a/src/schema.gql
+++ b/src/schema.gql
@@ -478,6 +478,7 @@ type VideoGQL {
   currentHomography: HomographyInfoGQL
   homographyHistory: [HomographyInfoGQL!]!
   currentProcessing: VideoProcessingGQL
+  comments: [CommentGQL!]!
 }
 
 type UploadStreamGQL {
@@ -611,6 +612,15 @@ type VideoProcessingStatusGQL {
   updatedAt: DateTime
 }
 
+type CommentGQL {
+  id: Int!
+  user: UserGQL!
+  message: String!
+  replies: [CommentGQL!]!
+  createdAt: DateTime
+  updatedAt: DateTime
+}
+
 type RunFeaturesGQL {
   runId: Int!
   indexInRun: Int!
@@ -800,6 +810,13 @@ type Mutation {
   editUploadStream(videoId: Int!, videoMetadata: VideoMetadataInput!): Boolean!
   deleteVideo(videoId: Int!): Boolean!
   deleteTags(videoId: Int!, tagsToDelete: [VideoTagInput!]!): Boolean!
+  commentOnVideo(
+    videoId: Int!
+    message: String!
+    parentCommentId: Int
+  ): Boolean!
+  editComment(videoId: Int!, commentId: Int!, newMessage: String!): Boolean!
+  deleteComment(videoId: Int!, commentId: Int!): Boolean!
 }
 
 input CreateBucketSetInput {
-- 
2.47.2