【发布时间】:2023-02-11 02:00:32
【问题描述】:
我为一个实体设置了一个存在过滤器:
#[ApiFilter(ExistsFilter::class, properties: ['firstName', 'lastName'])]
然后我可以很好地运行查询:
query accounts {
accounts(exists: {firstName: true}) {
edges {
node {
id
}
}
}
}
但我想参数化 exists 过滤器。我得到的最接近的是:
询问
query getAccounts($exists: [AccountFilter_exists]) {
accounts(exists: $exists) {
edges {
node {
id
}
}
}
}
参数
{
"exists": {"firstName": true}
}
但我收到此错误消息:
{
"errors": [
{
"message": "Variable \"$exists\" got invalid value {\"firstName\":true}; Expected type AccountFilter_exists to be an object at value.firstName.",
"extensions": {
"category": "graphql"
},
"locations": [
{
"line": 1,
"column": 19
}
]
}
]
}
有谁知道我要去哪里错了?
感谢您的帮助。
【问题讨论】: