mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 09:46:02 +08:00
Updating commentCount on comment post.
This commit is contained in:
@@ -38,7 +38,7 @@ export const postComment = graphql(POST_COMMENT, {
|
||||
},
|
||||
updateQueries: {
|
||||
AssetQuery: (oldData, {mutationResult:{data:{createComment:{comment}}}}) =>
|
||||
|
||||
|
||||
// If posting a reply
|
||||
parent_id ? {
|
||||
...oldData,
|
||||
@@ -56,6 +56,7 @@ export const postComment = graphql(POST_COMMENT, {
|
||||
...oldData,
|
||||
asset: {
|
||||
...oldData.asset,
|
||||
commentCount: oldData.asset.commentCount + 1,
|
||||
comments: [comment, ...oldData.asset.comments]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user