Closed asjones-code closed 2 years ago
What error are you getting?
@asjones-code after some try and check I've been able to reproduce your error. And it's simply your payload issue :)
For query like:
mutation createComment {
createComment(
input: {
relation: "api::page.page:1"
content: "Hello World!"
threadOf: 2
author: { id: 1234, name: "Sample one", email: "test@test.pl" }
}
) {
id
content
threadOf {
id
}
author {
id
name
}
}
}
Error like "message": "Strapi:Plugin:Comments - Not found",
is thrown because the threadOf
does not exist. If you follow documentation about Create comment (REST) (you've got a reference to it in GQL section also. You will see that threadOf
:
"threadOf": 2, // id of comment we would like to start / continue the thread (Optional)
So if you don't want to answer to an existing comment you're not using it, and that's your case I guess because you want to post first comment :)
Anyway to make it easy to understand we're going to lift the error message to be more descriptive.
Trying to post a comment with GraphQL as a test. Not working.
This is my query: https://www.npmjs.com/package/strapi-plugin-comments#post-a-comment-1
here's my plugins.js
My package.json