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

GraphQL: Inconsistent handling of removed comments #86

Closed dennis-hh closed 2 years ago

dennis-hh commented 2 years ago

When requesting comments via findAllInHierarchy, comments that have the removed flag set to true are omitted (this is in line with the REST API). However, when requesting comments via findAll or via a relation, they are included. I think it would be best if developers could control this behavior. In our case, we'd like to display something like "this comment has been removed", which is not possible when using findAllInHierarchy query. EDIT: As a workaround, I tried to do it like this: findAllInHierarchy(relation: "myrelation:1" where: "{\"_or\":[{ \"removed_null\": false },{\"removed\":false}]}"). However, this doesn't work, and I think the issue lies in services/comments.js, line 158. baseCriteria is used there, but it should be criteria. Also, using JSON as a string instead of native JSON is not nice (see #81).

cyp3rius commented 2 years ago

@dennis-hh we've fixed it in version 2.0.0-rc.2 dedicated for Strapi v4. Next in the queue there will be fix for v3.

cyp3rius commented 2 years ago

Closing, we won't provide this fix for v3. The 2.x version dedicated for Strapi v4 got it implemented by default.