Closed M1ck0 closed 2 years ago
@cyp3rius Any ideas?
@M1ck0 as I see you have got disabled the plugin queries. And probably you've added comments to not existing collections. Can you please check what settings you got per this plugin? Settings -> Comments plugin -> configuration
Adding this via not supported queries (that I see on your screen) caused errors as you are loosing all validation logic.
Settings are fine. They are added to collection Blogs, which is the only collection I currently have
And what do you mean by disabled the plugin queries
? Could you point me to some docs about it, because I can't seem to find anything about it.
As you can see here my Public
group has following permissions
Hello @M1ck0 I've schema on Strapi 4.1.1 and looks correct. Check please if you got it right. I assume you've added the comments via default Strapi mutation (which should be disabled) and that causes issues.
@cyp3rius
My schema is not the same as yours.
I have restarted Strapi after the changes. Currently, I reinstalled the whole strapi, still the same issue. These are the only mutations I have
Can you please share your config/plugins.js
? I'm interested in about the ordering of plugins as based on our doc it might be important.
I don't have plugins.js
. Only files present in config
directory are
admin.js
api.js
database.js
middleware.js
server.js
then try to put there and revert back with result:
module.exports = {
'comments': {
enabled: true,
}
};
Seems like default ordering of plugins in the Strapi lifecycle makes some problems with enabling GQL support for Comments
.
Still the same. I did yarn build
and yarn develop
after adding config/plugins.js
file with the content you provided.
Any updates on this?
I'm trying different configurations to reproduce this. Also in a meantime checking the other way to enable GQL support of plugin. It's clearly visible that bootstrap didn't enable it as expected
Can I do anything to help you with reproduction? This is really strange issue
Finally reproduced it, looking for a solution. Expect it in 1-2 days hopefully
Okay great. If I can do anything to help, just tell me. Hopefully we will resolve it
@M1ck0 found the fix for this issue. Try to put such configuration:
module.exports = {
'comments': { enabled: true },
'graphql': { enabled: true },
};
The problem is indeed what we have described in docs about GraphQL configuration. Installed plugins are ordered by default somehow by Strapi and the custom Comment plugin schemas are not injected before GraphQL plugin runs.
We will work on it with Strapi to figure out a way to "order" it properly. But as for now it should solve your issue and also it wont break anything existing :)
@cyp3rius It is still not working. Everything is the same. I'll try to reinstall the whole project again later to see if it is working from scratch, then I'll come back to you with the result.
I've did it against the plain strapi example we've got prepared for this plugin + made a settings for at least single collection there.
@cyp3rius Could this be of any help?
It is working now, but I thought I should provide you with this image if it was something important. Thank you for your help. Initializing new project and using
module.exports = {
'comments': { enabled: true },
'graphql': { enabled: true },
};
in config/plugins.js
did the trick
Thats the dependency inside the GraphQL plugin so typical warning :)
I've already asked question to Strapi team to check if there is a possibility to force plugins orders by their dependencies as Thats purely the issue. By this trick with plugins.js
you are forcing the ordering.
As its solved, lets close the issue and I will keep eye this.
@cyp3rius same thing happens with strapi 4.1.5.
Strapi didn't fixed it I assume :) So the trick must be applied as for now.
Just putting this here for folks who can't find their missing query types (i.e. findAllInHierarchy
not in the schema/not queryable) with this setup. I had to explicitly add the collection types to Settings > Comments > General Configuration > Enable comments only for
in order for the generated GQL code for the query types to be in the resulting schema + queryable through GQL.
When I create comments through graphql it works as it should (with some queries missing, read below for this). But I get this error when trying to load comments in Strapi. This is the image
Any ideas what could be the issue? This is log in the console
Also, these are all available queries and mutations for comments. Judging by the docs, some of them are missing, and are named incorrectly.
This is new Strapi installation.
I have custom
config/env/production/database.js
file with this contentNode: 16.13.1 Strapi: 4.1.1 npm: 8.1.2 yarn: 1.22.17 OS: Linux