Skip field based on another field?

Hi guys,

Hope you can help me with that.

I have a query like this

query {
  queryPost {
    id
    active
    title
    text
  }
}

The thing is that I want to show or not the Post text based on the active field, like so

query {
  queryPost {
    id
    active
    title  
    text @skip(if: active)
  }
}

Does that make sense?

Hi @masmerino, Welcome to the Dgraph community!!
Currently, in the @skip directive only Boolean value can be passed i.e. true or false
So you can’t specify anything else there. But you have an interesting use case.
We will discuss it internally and maybe we can add this behavior also.