How to apply a Hasura `where` filter only if a variable is not null?

I have a query like this:query getUsers ($setId: Int) { user(where: { user_sets: { set_id: { _in: [$setId] } } }) { id name status user_sets { set { name } } # more fields... }}What I'm looking for, is a way to not apply the where filter and give all entries if $setId is null. I'd like to avoid dynamically writing the query - it'd be easy to do something like this, but we want queries in static .graphql files:const query = `query getUsers (${ setId ? '$setId: Int' : ''}) { user(${ setId ? 'where: { user_set...Read more

How do I make a Hasura data API query to fetch rows based on the length of the their array relationship's value?

Referring to the default sample schema mentioned in https://hasura.io/hub/project/hasura/hello-world/data-apis i.e. to the following two tables:1) author: id,name2) article: id, title, content, rating, author_idwhere article:author_id has an array relationship to author:id.How do I make a query to select authors who have written at least one article? Basically, something like select author where len(author.articles) > 0...Read more