The first condition is always overriden with the second condition.
or: [
{
approved: {
equals: true,
},
},
...(user
? [
{
user: {
equals: user.id,
},
},
]
: []),
],
and: conditions,
Ok apparently there can only be one top level condition.
This works:
and: [
...conditions,
{
or: [
{
approved: {
equals: true,
},
},
...(user
? [
{
user: {
equals: user.id,
},
},
]
: []),
],
},
],