summaryrefslogtreecommitdiffstats
path: root/src/ts
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-17 23:29:10 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-17 23:48:06 +0100
commit50d37beeb51c95aaead8b3ef2c946189a066486e (patch)
tree61b812d884251767e3ffd4a99d76968d680f9bd0 /src/ts
parentefed6c0a820c5c47e097fa29455157bbd318ffca (diff)
chore: create mutation to add a new comment on posts
Diffstat (limited to 'src/ts')
-rw-r--r--src/ts/types/comments.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ts/types/comments.ts b/src/ts/types/comments.ts
index 51852d0..a1bb120 100644
--- a/src/ts/types/comments.ts
+++ b/src/ts/types/comments.ts
@@ -26,3 +26,25 @@ export type RawComment = Omit<Comment, 'author'> & {
export type CommentsResponse = {
nodes: RawComment[];
};
+
+export type CreatedComment = {
+ clientMutationId: string;
+ success: boolean;
+ comment: null | {
+ approved: boolean;
+ };
+};
+
+export type CreatedCommentResponse = {
+ createComment: CreatedComment;
+};
+
+export type CreatedCommentReturn = (
+ author: string,
+ authorEmail: string,
+ authorUrl: string,
+ content: string,
+ parent: number,
+ commentOn: number,
+ mutationId: string
+) => Promise<CreatedComment>;