pkdkk
pkdkk

Reputation: 3963

GraphQL/Graph.cool Query filter nested relation

I'm a newbie to graphql / graphcool, so this might be simple, but haven't found a solution for this in the documentation or here.

I have a "Product" model with one to many relations on "Bid" model I want to to get all the bids for at product, but only the bids where user is NOT null. How to do so? this is my none working solution:

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
    }
  }
}
}

error::

Argument 'filter' expected type 'BidFilter' but got: {user_not: null}. Reason: 'user_not' Field 'user_not' is not defined in the input type 'BidFilter'

Upvotes: 1

Views: 1896

Answers (1)

pkdkk
pkdkk

Reputation: 3963

Finally … I got it to work … sorry for disturbance …

...
bids(filter: {user: {id_not: null}}, first: 3, orderBy: price_DESC) {
...

Upvotes: 4

Related Questions