在我的 gatsby 站点中看到查询 Prismic 数据源并按内容关系过滤的一些奇怪行为。我正在尝试创建一个页面,根据传递到此页面的类别过滤一些产品。阅读 Prismic 和 Gatsby 文档,我应该能够使用该where
子句过滤数据,但是当我尝试构建时出现此错误
error Unknown argument "where" on field "allPrismicModel" of type "Query"
以下是查询的相关部分
query getProducts($uid: String) {
allPrismicModel(where: { system_category: $uid }) {
edges {
node {
data {
system_category {
uid
}
...other fields here...
}
}
}
}
}
有人遇到过这种情况或知道如何解决吗?