This repository was archived by the owner on Feb 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Expand file tree Collapse file tree 2 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,13 @@ const mutationAddComment = gql`
11
11
$postId: Int!
12
12
$content: String!
13
13
) {
14
- createComment (
15
- input: {
16
- author: $author,
17
- authorEmail: $authorEmail,
18
- authorUrl: $authorUrl,
19
- commentOn: $postId,
20
- content: $content
21
- }
22
- ) @rest(type: "Comments", path: "${ wpDataEndpoints . comments } ?{args}") {
14
+ postComment (
15
+ author: $author,
16
+ authorEmail: $authorEmail,
17
+ authorUrl: $authorUrl,
18
+ postId: $postId,
19
+ content: $content
20
+ ) @rest(type: "Comments", path: "${ wpDataEndpoints . postComment } ?{args}") {
23
21
comment {
24
22
${ commentsFields }
25
23
}
Original file line number Diff line number Diff line change 1
- import mutationAddComent from './mutationAddComment'
1
+ import mutationAddComment from './mutationAddComment'
2
2
import { initializeFeApollo } from '../../connector'
3
3
4
4
/**
@@ -33,8 +33,8 @@ export default async function postComment(
33
33
const apolloClient = initializeFeApollo ( )
34
34
35
35
return apolloClient
36
- . query ( {
37
- query : mutationAddComent ,
36
+ . mutate ( {
37
+ mutation : mutationAddComment ,
38
38
variables : {
39
39
author,
40
40
authorEmail,
You can’t perform that action at this time.
0 commit comments