When using the typescript client with AutoQuery endpoint all queries are added as AND. I have seen in docs that I can change default of a specific property to be OR but what I am trying to do is build up queries that use both.
For instance this query I am specifying a name containing “ic” and age over 18:
const client = new JsonServiceClient(environment.apiUrl);
var r = await client.get(request, {
AgeGreaterThan: 18,
NameContains: "ic"
});
return r;
What if I wanted to the query to be (name.Contains("ic") AND (Age > 18 || Guardian == true). Is this possible?
So something like:
var r = await client.get(request, {
OR: [{AgeGreaterThan: 18},{GuardianEqualTo: true}]
NameContains: "ic"
});
What is simplest way to stack up certain conditions with OR?
Thanks for the quick reply. I am trying to wrap all AG grid filters to AutoQuery (which match up really nicely) but AG grid supports 2 filters per column and lets user define if it should be AND/OR relationship. The custom filter template is a nice way to handle it but I was hoping to get something generic that let me quickly drop an ag grid onto an AutoQuery endpoint and all the functionality matches up which is kind of hard to do with static properties. I guess it’s not possible.