When adding en entry through a mutation I get null as a return when I'm using a siteId in the query
mutation saveProduct{
save_products_products_Entry(
authorId: 1
siteId: 1
productName: "abc"
){
id
productName
}
}
Output:
{
"data": {
"save_products_products_Entry": {
"id": "46853",
"productName": "abc"
}
}
}
mutation saveProduct{
save_products_products_Entry(
authorId: 1
siteId: 2
productName: "abc"
){
id
productName
}
}
Output:
{
"data": {
"save_products_products_Entry": null
}
}
And expected output would also be
{
"data": {
"save_products_products_Entry": {
"id": "46853",
"productName": "abc"
}
}
}
This user on stack overflow has the same issue:
https://craftcms.stackexchange.com/questions/36611/how-can-i-have-created-data-id-returned-for-a-graphql-mutation
@edwwaarrdd is the entry saved in the second case? If not, perhaps the section is not enabled for the site in question?
If none of that provides any answers - is there anything in the error logs? If not, is it an option to update to Craft 3.6.2? One of the changes there is improved error logging for GraphQL operations, which should help track this down.
@andris-sevcenko
Yes the entry is saved and I can fetch it with a query request to the graphql endpoint.
I will try to update the instance locally to 3.6.2 today and see if I can find anything in the logs.
@edwwaarrdd looking forward to it!
@andris-sevcenko
I updated to 3.6.2 locally and tried the query again still null as a return when given a siteId other than 1.
I cleared all the log files and closed all tabs where the cms was active as to not add other stuff to the log.
And did a call from insomnia and the web.log file is 11461 lines long 馃槄.
What do you want me to look for? or can I email the file to you?
@edwwaarrdd can you send a DB dump and your composer.json/lock files over to [email protected], while referencing this issue? I'll see if I can reproduce this locally and see what's what!
@andris-sevcenko Sent the email with everything in it
Thank you! Fixed for the next Craft 3.6 release!
Craft 3.6.5 is out now with that fix.
Most helpful comment
Thank you! Fixed for the next Craft 3.6 release!