【问题标题】:GraphQL some params in where queryGraphQL where 查询中的一些参数
【发布时间】:2020-12-07 18:41:02
【问题描述】:

如何在 GraphQL 查询的 where 部分创建带有一些参数的查询。

我有一个参数的查询,我需要向该查询添加一些参数。

query{
  places(where:{longitude_gte:21.00}){
    latitude
    location
    name
    phoneNumber
  }
}

【问题讨论】:

  • 具体实现 - 请参阅 API 文档
  • 非int需要在json中加引号...places(where:{longitude_gte:"21.00"}){

标签: graphql strapi


【解决方案1】:

像这样:

restaurants(where:{name_contains:["McD","King"],id_gt:5})

为您提供名称包含“McD”或“King”且 id 大于“5”的餐厅

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-01-06
    • 2021-08-22
    • 2020-09-09
    • 2017-11-14
    • 2023-01-25
    • 2022-08-05
    • 2021-04-03
    • 2021-01-14
    相关资源
    最近更新 更多