1

我是 graphql / graphcool 的新手,所以这可能很简单,但在文档或此处没有找到解决方案。

我有一个“产品”模型,在“出价”模型上具有一对多关系,我想获得产品的所有出价,但只有用户不为空的出价。怎么做?这是我没有工作的解决方案:

query Product($slug: String) {
Product(slug: $slug) {
  id
  slug
  _bidsMeta {
    count
  }
  bids(filter:{user_not:null}, first:3, orderBy:price_DESC) {
    id
    price
    createdAt
    user {
      id
      email
    }
  }
}
}

错误::

参数“过滤器”预期类型“BidFilter”,但得到:{user_not:null}。原因:“user_not”字段“user_not”未在输入类型“BidFilter”中定义

4

1 回答 1

4

终于……我开始工作了……抱歉打扰了……</p>

...
bids(filter: {user: {id_not: null}}, first: 3, orderBy: price_DESC) {
...
于 2018-02-24T19:55:35.800 回答