VirtusLab-Open-Source / strapi-plugin-comments

A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
MIT License
409 stars 64 forks source link

Incorrect graphql field #182

Closed Malarkey-Jhu closed 1 year ago

Malarkey-Jhu commented 1 year ago

I follow the readme and download the latest version of plugin which is 4.5.5. However, there is no findAllInHierarchy in graphql query and all other fields slisted in the readme. e.g. createComment. Instead there are fields like commentsComment(id: ID): CommentsCommentEntityResponse

And also, the plugin creates table like this: comments_comment, comments_comment-report. Which is a little bit wired, not sure if it is correct.

strapi-version: 4.5.4 strapi-plugin-comments: 4.5.5

截圖 2022-12-30 下午12 23 04

截圖 2022-12-30 下午12 24 04
Malarkey-Jhu commented 1 year ago

Also, how can I uninstall this plugin fully. Right now, I run yarn remove strapi-plugin-comments and manully delete the tables in db. Yet, I realize there are some places that need to be cleaned as well such as strapi_database_schema

Malarkey-Jhu commented 1 year ago

in plugin.js file

module.exports = ({ env }) => ({
  comments: {
    enabled: true,
    config: {
      moderatorRoles: [],
      badWords: true,
      enabledCollections: [ 'api::article.article' ],
      approvalFlow: [],
      entryLabel: {
        'api::article.article': [ 'Title' ]
      },
      reportReasons: {
        BAD_LANGUAGE: 'BAD_LANGUAGE',
        DISCRIMINATION: 'DISCRIMINATION',
        OTHER: 'OTHER'
      }
    }
  },
  graphql: {
    enabled: true,
  }
});
cyp3rius commented 1 year ago

Hello @Malarkey-Jhu ,

That seems plugin GQL hasn't been initialised properly for you. Please check if you've got such entry in the GQL schema:

createComment(input: CreateComment!): CommentSingle!

If yes, than all is fine. If not, please provide more detailed info about env and your Strapi config.

In terms of DB tables, that's something created automatically by Strapi itself based on entities definitions. Not something we control, as well as during the uninstall process.

cyp3rius commented 1 year ago

Closing as outdated.

thekeels commented 1 year ago

I'm having the same issue, strapi 4.9, strapi-plugin-comments 2.2.9

cyp3rius commented 1 year ago

@thekeels I assume you've provided definition for comments plugin before graphql in the plugins.js?

thekeels commented 1 year ago

@cyp3rius No, the way I read the documentation it sounded like for 2.0.3 and newer you can just use the GUI to configure the settings, without doing anything to the plugins.js file.

cyp3rius commented 1 year ago

Check this from readme as well: https://github.com/VirtusLab-Open-Source/strapi-plugin-comments#additional-gql-configuration

Its not about plugin config but enabling comments before graphql. Plugin configuration you can do in GUI and this is recommended.

thekeels commented 1 year ago

Thanks, that was the problem. I didn't have graphql or comments defined in my plugins.js file.

cyp3rius commented 1 year ago

Thats what I thought. Nasty nasty but working solution to enforce init order.