diff options
Diffstat (limited to 'src/ts/types/comments.ts')
| -rw-r--r-- | src/ts/types/comments.ts | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/src/ts/types/comments.ts b/src/ts/types/comments.ts index a1bb120..d5c0052 100644 --- a/src/ts/types/comments.ts +++ b/src/ts/types/comments.ts @@ -1,10 +1,14 @@ +//============================================================================== +// Comments query +//============================================================================== + export type CommentAuthor = { gravatarUrl: string; name: string; url: string; }; -export type CommentAuthorResponse = { +export type RawCommentAuthor = { node: CommentAuthor; }; @@ -19,14 +23,28 @@ export type Comment = { replies: Comment[]; }; -export type RawComment = Omit<Comment, 'author'> & { - author: CommentAuthorResponse; +export type RawComment = Omit<Comment, 'author' | 'replies'> & { + author: RawCommentAuthor; }; -export type CommentsResponse = { +export type CommentsNode = { nodes: RawComment[]; }; +//============================================================================== +// Comment mutations +//============================================================================== + +export type CommentData = { + author: string; + authorEmail: string; + authorUrl: string; + content: string; + parent: number; + commentOn: number; + mutationId: string; +}; + export type CreatedComment = { clientMutationId: string; success: boolean; @@ -35,16 +53,6 @@ export type CreatedComment = { }; }; -export type CreatedCommentResponse = { +export type CreateComment = { createComment: CreatedComment; }; - -export type CreatedCommentReturn = ( - author: string, - authorEmail: string, - authorUrl: string, - content: string, - parent: number, - commentOn: number, - mutationId: string -) => Promise<CreatedComment>; |
