Add equivalent of Dgraph's 'has' to GraphQL

Moved from GitHub dgraph/5819

Posted by MichaelJCompton:

It’s currently not possible to filter in GraphQL by if a node does or does not have a particular edge. We, should port Dgraph’s has condition to solve that.

Expect it to look like

queryUser(filter: { has: friends }) { 
   ... 
} 

or

{
  queryUser(filter: {firstName: {eq: null}}) {
    username
    firstName
  }
}

please track this issue here: Tracking zero counts

Fixed by: https://github.com/dgraph-io/dgraph/pull/6258

1 Like