I think there is some confusion here about what uid_in is supposed to do.
Say node with uid 5 has a set of friends A.
5 - friend => [A]
The uid_in would filter and retain the nodes in set A which have a friend with uid 0x9. Note that edges in Dgraph are not bidirectional so you get nodes which are friend of 0x5 and who have 0x9 as a friend. Node with uid 0x9 doesn’t need to be friends with this set.
To get common friends, you could do something like