
[英]GraphQL - How do I use the return value as a variable for the next query?
[英]How do I use GraphQL to query the options for a KeystoneJS select field
KeystoneJS 中的类型似乎使用以下格式命名:
<list name><field name>Type
此外,如果<list name>
或<field name>
的第一个字母是小写的,则将它们更改为大写。 因此,对于问题中给出的示例,字段status
的类型名称将是:
OrderStatusType
然后可以使用以下方式查询可用选项:
query {
__type (name: "OrderStatusType") {
enumValues {
name
}
}
}
在使用 Postgres 数据库的标准 KeystoneJS 安装上进行了测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.