- The first query won’t work. Cuz the variable doesn’t propagate well in multiple level querying.
- The second one would be the right approach. But you should limit it for a single user. Not 3 or more. Cuz Dgraph injects all users found in “knows_uid” from all users found. Unless you wanna this behave.
I have written about the first issue here Promise a nested block (under construction - I'm still working in the use case)
For the second one, I think a loop might help there FOREACH func in DQL (loops in Bulk Upsert)
What do you mean? collect a list of users and then use them to filter? your first query is collecting users in a different way. If you wanna use a list of users as a parameter, this should be a separate block with its constraints and then you can use it in the target block. But I feel like that’s not what you mean.