【发布时间】:2019-12-28 09:00:33
【问题描述】:
我无法通过 graphql Playground 在 Strapi 中获得使用“OR”条件的 WHERE 语句。
我想返回“标题”或“内容”字段包含 search_text 的所有结果。
我尝试了以下方法:
articles(where: {
or: [
{"title_contains" : "search_text"},
{"content_contains" : "search_text"}
]
}) {
title
content
}
但返回错误。
错误:“您的过滤器包含一个字段‘或’,它既没有出现在您的模型定义中,也没有出现在它的关系中。
一些有效的陈述(但不是我所追求的):
where: { "title_contains" : "sometext" }
工作,但表现为“与”
where: {
"title_contains" : "search_text",
"content_contains" : "search_text"
}
【问题讨论】:
-
您好!此功能在 Strapi 中不可用。您能否在 GitHub 存储库上创建一个功能请求。
标签: graphql where-clause strapi