I am getting below error while trying to run the application in server.
Request url http://server-name3000/admin-api
Request object:
{
"operationName": "SearchProducts",
"variables": {
"input": {
"skip": 0,
"take": 10,
"term": "",
"facetValueIds": [
],
"groupByProduct": true
}
},
"query": "query SearchProducts($input: SearchInput!) {\n search(input: $input) {\n totalItems\n items {\n enabled\n productId\n productName\n productAsset {\n id\n preview\n focalPoint {\n x\n y\n __typename\n }\n __typename\n }\n productVariantId\n productVariantName\n productVariantAsset {\n id\n preview\n focalPoint {\n x\n y\n __typename\n }\n __typename\n }\n sku\n channelIds\n __typename\n }\n facetValues {\n count\n facetValue {\n id\n createdAt\n updatedAt\n name\n facet {\n id\n createdAt\n updatedAt\n name\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n"
}
Response message:
ER_WRONG_FIELD_WITH_GROUP: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'vendure.si.enabled' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Can you please suggest how to solve this.
Hi, this sounds like something another user ran into when using MySQL. Their solution was to run:
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))
See https://stackoverflow.com/a/41887627/772859
TODO: Set up e2e tests against MySQL (not just MariaDB as is currently the case) and resolve this issue without the need for a work-around.
@michaelbromley It worked! Thank you.
Most helpful comment
Hi, this sounds like something another user ran into when using MySQL. Their solution was to run:
See https://stackoverflow.com/a/41887627/772859
TODO: Set up e2e tests against MySQL (not just MariaDB as is currently the case) and resolve this issue without the need for a work-around.