From 847b7303278c7894e5d6b055e0e654f6cf809330 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 9 Mar 2022 23:23:47 +0100 Subject: refactor: update graphql queries (#14) * refactor: replace postBy query postBy is now deprecated in WPGraphQL v1.7 * refactor: update post comments query PostBy is deprecated and it is now possible to use the post ID to query comments. * refactor: update get topic by slug query topicBy is deprecated * refactor: update get thematic by slug query thematicBy is deprecated --- src/components/Comment/Comment.tsx | 13 ++++++++----- src/components/CommentsList/CommentsList.tsx | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/components') diff --git a/src/components/Comment/Comment.tsx b/src/components/Comment/Comment.tsx index 0371288..e20c5aa 100644 --- a/src/components/Comment/Comment.tsx +++ b/src/components/Comment/Comment.tsx @@ -67,7 +67,10 @@ const Comment = ({ const getApprovedComment = () => { return ( <> -
+
{comment.author.gravatarUrl && (
@@ -89,7 +92,7 @@ const Comment = ({
@@ -118,7 +121,7 @@ const Comment = ({ {shouldOpenForm && ( )} {comment.replies.length > 0 && ( @@ -127,7 +130,7 @@ const Comment = ({ return ( @@ -152,7 +155,7 @@ const Comment = ({ const schemaJsonLd: WithContext = { '@context': 'https://schema.org', - '@id': `${settings.url}/#comment-${comment.commentId}`, + '@id': `${settings.url}/#comment-${comment.databaseId}`, '@type': 'Comment', parentItem: isNested ? { '@id': `${settings.url}/#comment-${comment.parentDatabaseId}` } diff --git a/src/components/CommentsList/CommentsList.tsx b/src/components/CommentsList/CommentsList.tsx index 1e7c3e7..4ea2fc2 100644 --- a/src/components/CommentsList/CommentsList.tsx +++ b/src/components/CommentsList/CommentsList.tsx @@ -33,7 +33,7 @@ const CommentsList = ({ return data.map((comment) => { return ( -- cgit v1.2.3