When I try to replicate some @whereConditions from the docs to group AND/OR clauses, I see a strange behaviour on the output SQL.
Using a where conditions like below:
where: {
AND: [
{ column: STATUS, operator: EQ, value: "Active" }
{
OR: [
{ column: CITY, operator: EQ, value: "New York" }
{ column: CITY, operator: EQ, value: "Miami" }
]
}
]
}
I get the following buggy SQL:
where (`status` = 'Active' or (`city` = 'New York' or `city` = 'Miami'))
But the expected output should be:
where (`status` = 'Active' and (`city` = 'New York' or `city` = 'Miami'))
Environment
Lighthouse Version: 4.10.2
Laravel Version: 5.8.30
Thanks for the report. Can you try and add a failing test case to https://github.com/nuwave/lighthouse/blob/master/tests/Integration/WhereConditions/WhereConditionsDirectiveTest.php ?
Yes, sure. I'll try to provide a test case this week. Thanks for pointing out the test file.
Fixed in release https://github.com/nuwave/lighthouse/releases/tag/v4.12.4