i.e. Why does Dgraph only give responses like
{
"data": {
"user": [
{
"uid": "0x5c1c",
"settings": [
{
"account": [
{
"email": "me@test.com"
}
]
}
]
}
]
},
"extensions": {
"server_latency": {
"parsing_ns": 24104,
"processing_ns": 4277851,
"encoding_ns": 12867,
"assign_timestamp_ns": 537711
},
"txn": {
"start_ts": 103396
}
}
}
instead of having the option to get responses like
{
"data": {
"user": {
"uid": "0x5c1c",
"settings": {
"account": {
"email": "me@test.com"
}
}
}
},
"extensions": {
"server_latency": {
"parsing_ns": 24104,
"processing_ns": 4277851,
"encoding_ns": 12867,
"assign_timestamp_ns": 537711
},
"txn": {
"start_ts": 103396
}
}
}
If I want to get a user’s email, I have to do res.data.user[0].settings[0].account[0].email
, but ideally, I’d like to do res.data.user.settings.account.email
. Or does Dgraph already have a feature that I’m not aware of that allows me to get a response like the latter example?