如何在 Strapi、GraphQL 中的 where 子句中使用多个“and”条件进行查询?

Muh*_*tov 5 where-clause apollo graphql strapi angular

现在我尝试在 Strapi GraphQL 游乐场中的位置内使用多个 _and 进行查询。我正在使用的查询是:

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

但出现错误提示如下:

 "Error: Your filters contain a field '_and' that doesn't appear on your model definition nor it's relations".
Run Code Online (Sandbox Code Playgroud)

如何使用 GraphQL 在 Strapi 中使用多个 _and 条件 where 子句正确进行查询

小智 2

clients(
  where: {
    and: [{ name: { contains: "a" } }, { endDate: { gte: "2017-12-31" } }]
  }
) {
    id
    name
    endDate
    reasonForEnding
  }
Run Code Online (Sandbox Code Playgroud)

这就是答案