How to query with multiple 'and' conditions in where clause in Strapi, GraphQL?

Viewed 4104

Now I am trying to query with multiple _and inside where in Strapi GraphQL playground. The query I am using is:

 {
  clients(
    where: {
      _and: [{ name: { _contains: "a" } }, { endDate: { _gte: "2017-12-31" } }]
    }
  ) {
    id
    name
    endDate
    reasonForEnding
  }
}

But getting an error with says the following:

 "Error: Your filters contain a field '_and' that doesn't appear on your model definition nor it's relations".

How to do properly query with multiple _and conditions where clause in Strapi with GraphQL

1 Answers
clients(
  where: {
    and: [{ name: { contains: "a" } }, { endDate: { gte: "2017-12-31" } }]
  }
) {
    id
    name
    endDate
    reasonForEnding
  }

This is the answer

Related