diff options
Diffstat (limited to 'src/services')
| -rw-r--r-- | src/services/graphql/post.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/services/graphql/post.ts b/src/services/graphql/post.ts index 2ce918b..e827fd4 100644 --- a/src/services/graphql/post.ts +++ b/src/services/graphql/post.ts @@ -104,7 +104,10 @@ const fetchPostBySlug: FetchPostByReturn = async (slug: string) => { export const getPostBySlug: GetPostByReturn = async (slug: string) => { const rawPost = await fetchPostBySlug(slug); - const comments = rawPost.postBy.comments.nodes; + const comments = rawPost.postBy.comments.nodes.reverse().map((comment) => { + const author = comment.author.node; + return { ...comment, author: author, replies: [] }; + }); const content = rawPost.postBy.contentParts.afterMore; const featuredImage = rawPost.postBy.featuredImage ? rawPost.postBy.featuredImage.node |
