【发布时间】:2020-09-22 15:48:11
【问题描述】:
我目前正在使用 userId 查询我的 Hasura 数据库以获取位置。
users(where: {id: {_eq: 1528}}) {
location
}
然后我使用位置来查询该用户附近的用户。
users(
where:
{ location: {_st_d_within: {distance: 20000, from: $point }}},
) {
firstName
city
region
}
}
有没有办法有效地组合这两个查询,以便我只查询一次?
【问题讨论】:
-
您好,我有点困惑在同一个查询中使用多个过滤器有何帮助。我首先需要使用 id 1528 进行查询以获取位置。只有这样我才有位置过滤下一系列结果。
-
嗯......你不能在一个查询中做到这一点
标签: postgresql graphql subquery hasura