How to set func to null

I understand where you are at. “How do you do an OR” in DQL root function to get two nodes by id if the root function only accepts a single function

There are two primary ways to do this.

Wider Function Query with Filter to reduce

You have to have a root function, so if your root function is wide enough the include both of the smaller functions then you can do it all in a single query block:

{
  sourceNodes(func: has(identity_id)) @filter(eq(identity_id, "test_1_lyf00824") OR eq(identity_id, "269783243924963328")) {
    uid
    # other predicates/edges
  }
}

Pros: A single query block easy to create dynamically
Cons: Touches more nodes causing decreased efficiency

Var Blocks for Better Performance

Alternatively, you can only touch the two nodes that you need at the root level by using var blocks to get the uids of the specific nodes. The uid function accepts a list of ids or variables in a single function. This list acts as an any of logic, so this exact syntax would not work to get nodes that intersect between two variables.

{
  var var1(func: eq(identity_id, "test_1_lyf00824"))
  var var2(func: eq(identity_id, "269783243924963328"))
  sourceNodes(func: uid(var1, var2)) {
    uid
    namespace
    # other predicates/edges
  }
}

Pros: More efficient. Touches only the nodes expected.
Cons: Can be more complex to create dynamically. Only works with OR logic ATM. (See Intersect version of uid(…) )