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

标签 angular graphql where-clause apollo strapi

现在我正在尝试在 Strapi GraphQL playground 中的 where 中使用多个 _and 进行查询。我正在使用的查询是:

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

但是出现以下错误:

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

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

最佳答案

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

这就是答案

关于angular - 如何在 Strapi、GraphQL 的 where 子句中使用多个 'and' 条件进行查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65420524/

相关文章:

c# - 我可以在没有 Entity Framework 的情况下使用 graphql-dotnet 吗?

mysql - 如果 Left Join 返回行,条件 Where 子句?

postgresql - where 子句中的 lower() 与模式不匹配

angular - 如何在不使用 HttpIntercepter 的情况下在 Angular 中获取自定义响应 header

javascript - 如何使用 GraphQL 将二进制数据发送回客户端

javascript - 连接扁平数据

c# - 使用 Github 的 GraphQL 列出所有标签并搜索版本

android - 靠近 "WHERE": syntax error - SQLite

angular - 属性绑定(bind)与属性插值

javascript - 在 Angular 15 项目中运行 Scully?