How to find nodes given an array of values

Yes, build your query to englobe your array.

As you can see in the documentation of inequality you have a syntax option with array.

  • eq(predicate, [val1, val2, ..., valN])

e.g:

{
  me(func: eq(predicate, [val1, val2, ..., valN])) {
    name@en
    genre {
    	name@en
    }
  }
}

or in JS


const many_emails = [e1@domain1.com, e2@domain2.com, ..., eN@domainN.com]

const query = `
    {
  me(func: eq(predicate, ${many_ emails})) {
    name@en
    genre {
    	name@en
    }
  }
}
       `;
3 Likes