【发布时间】:2021-09-07 14:27:47
【问题描述】:
如何在 Hasura graphql(console) 中为以下给定的 API 响应定义 Action 类型?
{
"data": [
{
"name": "Jordan Smith",
"id": 101,
"location": "Florida",
"speciality_id": 214
},
{
"name": "Cathy Morphy",
"id": 104,
"location": "london",
"speciality_id": 214
}
],
"count": 2 }
【问题讨论】:
-
如果您的操作的响应实际上与架构中的现有对象相关。因此,您可以简单地从动作响应中返回 id 并与该 id 建立关系。如果没有,请告诉我们一些有关您的表结构的信息
-
type SearchDoctorsOutput {医生:json count:Int}类型查询{search_doctor(speciality_id:Int搜索:字符串限制:Int offset:Int):SearchDoctorsOutput}类型SearchDoctorsOutput {医生:json count:Int}可以我们这样提到
-
我认为您不能在输出类型中嵌套对象类型(医生)。我认为这行不通
-
还有其他选项