I am learning dgraph and GraphQL± and I created a simple friends graph to experiment on.
I am issuing a query to get all the friends of a node, in two different ways.
The first way, when I explicitly name properties, returns all the friends of 0x1.
The second, which uses expand(all) omits 0x3 which only has incoming friends and no other edges.
Does expand ignore nodes that have no outgoing edges?
QUERY
{
# get friends of 0x1, and their incoming friends.
x1friends(func: uid(0x1)) {
friend {
uid
name
~friend { uid}
}
}
# get friends of 0x1, and expand the results
x1friendsexpanded(func: uid(0x1)) {
friend {
expand(_all_)
}
}
}
RESPONSE
{
"data": {
"x1friends": [
{
"friend": [
{
"uid": "0x2",
"name": "Mehdi",
"~friend": [
{
"uid": "0x1"
}
]
},
{
"uid": "0x3",
"~friend": [
{
"uid": "0x1"
},
{
"uid": "0x2"
}
]
}
],
"uid": "0x1"
}
],
"x1friendsexpanded": [
{
"friend": [
{
"name": "Mehdi",
"uid": "0x2"
}
],
"uid": "0x1"
}
]
},
"extensions": {
"server_latency": {
"parsing_ns": 18195,
"processing_ns": 2506983,
"encoding_ns": 768663
},
"txn": {
"start_ts": 2108
}
}
}
Thanks!