Query a list of objects using DQL is not possible

Hi Ahmed,

Hum, I don’t have a clue why we have that function ‘in’ in GraphQL - I feel that the inequality should do the job pretty fine without a new function. I’m not 100% aware of GraphQL features. But I can help you with DQL, which I have some experience with.

Follow me on this syntax https://dgraph.io/docs/query-language/functions/#equal-to
The syntax eq(predicate, [val1, val2, ..., valN]) says you can input several values as a param of the function for that X predicate. You can simply use values there instead of variables. e.g: eq(predicate, ["a","b","c"]). Since the last time I have used that feature, it was working fine. Can you check if it works for you?

Try this query at http://play.dgraph.io/ (you can play around with other names)

{
  me(func:eq(name@en, ["James", "Jobs"]) ) {
    name@en
    genre {
      name@en
    }
  }
}

Cheers.

1 Like