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
407 stars 63 forks source link

GraphQLError: Syntax Error: Expected Name, found "}" #79

Closed denisoed closed 2 years ago

denisoed commented 2 years ago

Hi.

Plugin version 1.0.2 gives an error.

image

OS: Linux Ubuntu 20.04 Node: v14.17.3 Yarn: 1.22.10

Version 1.0.1 works fine

cyp3rius commented 2 years ago

@denisoed provide please the plugin config you've got. Stack trace is too general to suggest something.

diegoaguilar commented 2 years ago

@cyp3rius this is also happening for me using the 3.6 Strapi version and everything yarn installed

cyp3rius commented 2 years ago

@diegoaguilar as I asked above. Can you please provide more details? Some plugin config?

mykoshka commented 2 years ago

What kind of info? Strapi: v3.6.8 Docker: 20.10.7, build 20.10.7-0ubuntu1~20.04.2 Plugin: 1.0.3-beta.1 (latest at the time) OS: Ubuntu 20.04

No configuraiton, strapi fails to boot.

Screenshot of the dump image

cslz4 commented 2 years ago

I think its related to graphql support. Downgrade to 1.0.1 makes server boot again but cant see comments collection, just the infinity loading screen.

rerecampos commented 2 years ago

I had same error, without using GQL provider option, just upgrading to 1.0.2 version.

Strapi: v3.6.8 Plugin: v1.0.2 OS: Windows 10 Pro Node: v14.16.1 Strapi GQL plugin: v3.6.8

Current custom.js config:

I've already tried cleaning node_modules, installed everything again, ran the build on the strapi, ran in develop mode and still not working

image

cyp3rius commented 2 years ago

Have you tried to follow: https://github.com/VirtusLab-Open-Source/strapi-plugin-comments#additional-gql-configuration ?

rerecampos commented 2 years ago

Have you tried to follow: https://github.com/VirtusLab-Open-Source/strapi-plugin-comments#additional-gql-configuration ?

Yes, I've tried it with and without this GQL configuration, both give the same error mentioned above

ltsNotMike commented 2 years ago

I think the problem might be connected to the docs. The configuration for GraphQL should be inside config/plugins.js instead of config/custom.js. We have a pull request ready #87 to update the docs and migrate all configurations into plugins.js.

Example of plugins.js

module.exports = {
  comments: {
    relatedContentTypes: {
      movies: {
        uuid: 'application::movies.movies',
        contentManager: true,
        __contentType: '',
        key: 'title',
        value: 'id',
      }
    }
  },
}
rerecampos commented 2 years ago

I think the problem might be connected to the docs. The configuration for GraphQL should be inside config/plugins.js instead of config/custom.js. We have a pull request ready #87 to update the docs and migrate all configurations into plugins.js.

Example of plugins.js

module.exports = {
  comments: {
    relatedContentTypes: {
      movies: {
        uuid: 'application::movies.movies',
        contentManager: true,
        __contentType: '',
        key: 'title',
        value: 'id',
      }
    }
  },
}

Thanks! With this configuration the strapi was built, ran without problems and appeared in GQL!

mykoshka commented 2 years ago

@ltsNotMike Yap that worked for me too! I did have some issues, when trying to install directly in my existing project. So I started a new project rebuild the apis and exported -> important the data. Now it works perfectly...

Thanks

cyp3rius commented 2 years ago

Change of configuration source has been released as part 1.0.4.