Closed wbs-servicedesk closed 2 years ago
@wbs-servicedesk haha I was about to come and create the same issue. I was thinking of opening a PR to fix the issue unless you want to.
It looks like the same fix needs to be made in the findAll resolver as well
@PritamSangani Please go ahead and do the pull request, I am currently at work so I won't be able to do it anytime soon. Yeah, good catch!
@PritamSangani @wbs-servicedesk are you still interested in fixing this issue for v3
?
Closing, we won't provide this fix for v3. The 2.x
version dedicated for Strapi v4 got it implemented by default.
There is an issue with the schema.graphql.js file for the Query Resolver findAllInHierarchy.
You have it currently like this:
return strapi.plugins.comments.services.comments.findAllInHierarchy({ relation, **where**, dropBlockedThreads: true, });
When it should be something like this:
return strapi.plugins.comments.services.comments.findAllInHierarchy({ relation, **query: where**, dropBlockedThreads: true, });
The reason being is that your service
async findAllInHierarchy ({ relation, query, startingFromId = null, dropBlockedThreads = false, isAdmin = false, }) { const entities = await this.findAllFlat(relation, query, isAdmin); return buildNestedStructure(entities, startingFromId, 'threadOf', dropBlockedThreads, false, this.isMongoDB()); },
does not have any where param. I assume that you want to use the where as the query, so the change above should fix the issue. Otherwise where will be undefined when using a graphQL call.