Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tktcorporation committed Oct 10, 2022
1 parent 7aaedf7 commit 757e2d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/src/components/Article/Article.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Article = ({ article, summary = false }) => {
<div className="mt-12">
<CommentForm postId={article.id} />
<div className="mt-12">
<CommentsCell />
<CommentsCell postId={article.id} />
</div>
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/CommentForm/CommentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const CommentForm = ({ postId }: Props) => {
setHasPosted(true)
toast.success('Thank you for your comment!')
},
refetchQueries: [{ query: CommentsQuery }],
refetchQueries: [{ query: CommentsQuery, variables: { postId } }],
})
const onSubmit: SubmitHandler<FormValues> = (input) => {
createComment({ variables: { input: { postId, ...input } } })
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/CommentsCell/CommentsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import type { CellSuccessProps, CellFailureProps } from '@redwoodjs/web'
import Comment from 'src/components/Comment'

export const QUERY = gql`
query CommentsQuery {
comments {
query CommentsQuery($postId: Int!) {
comments(postId: $postId) {
id
name
body
Expand Down

0 comments on commit 757e2d9

Please sign in to comment.