aboutsummaryrefslogtreecommitdiffstats
path: root/src/ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/ts')
-rw-r--r--src/ts/types/app.ts5
-rw-r--r--src/ts/types/articles.ts3
-rw-r--r--src/ts/types/comments.ts8
3 files changed, 13 insertions, 3 deletions
diff --git a/src/ts/types/app.ts b/src/ts/types/app.ts
index 3edc8a0..8e087fd 100644
--- a/src/ts/types/app.ts
+++ b/src/ts/types/app.ts
@@ -3,7 +3,7 @@ import { AppProps } from 'next/app';
import { ReactElement, ReactNode } from 'react';
import { PostBy, TotalArticles } from './articles';
import { AllPostsSlug, RawPostsList } from './blog';
-import { CommentData, CreateComment } from './comments';
+import { CommentData, CommentsByPostId, CreateComment } from './comments';
import { ContactData, SendEmail } from './contact';
import {
AllTopics,
@@ -34,6 +34,8 @@ export type VariablesType<T> = T extends PostBy | TopicBy | ThematicBy
? Slug
: T extends RawPostsList
? CursorPagination
+ : T extends CommentsByPostId
+ ? { id: number }
: T extends CreateComment
? CommentData
: T extends SendEmail
@@ -46,6 +48,7 @@ export type RequestType =
| AllTopicsSlug
| AllThematics
| AllThematicsSlug
+ | CommentsByPostId
| CreateComment
| PostBy
| RawPostsList
diff --git a/src/ts/types/articles.ts b/src/ts/types/articles.ts
index 75e5a1a..ea90207 100644
--- a/src/ts/types/articles.ts
+++ b/src/ts/types/articles.ts
@@ -35,7 +35,6 @@ export type ArticleMeta = {
export type Article = {
author: ArticleAuthor;
commentCount: number | null;
- comments: Comment[];
content: string;
databaseId: number;
dates: Dates;
@@ -55,7 +54,6 @@ export type RawArticle = Pick<
> & {
acfPosts: RawACFPosts;
author: { node: ArticleAuthor };
- comments: CommentsNode;
contentParts: ContentParts;
date: string;
featuredImage: RawCover;
@@ -91,6 +89,7 @@ export type PostBy = {
};
export type ArticleProps = {
+ comments: Comment[];
post: Article;
};
diff --git a/src/ts/types/comments.ts b/src/ts/types/comments.ts
index 75e7d23..36bd98c 100644
--- a/src/ts/types/comments.ts
+++ b/src/ts/types/comments.ts
@@ -2,6 +2,14 @@
// Comments query
//==============================================================================
+export type CommentsByPostId = {
+ postBy: {
+ comments: {
+ nodes: RawComment[];
+ };
+ };
+};
+
export type CommentAuthor = {
gravatarUrl: string;
name: string;