This query is also not working
upsert {
query {
q(func: uid("0x9c49")) @recurse @normalize {
all_ids as uid
branches.child_groups
child_groups.branches
}
}
mutation {
delete {
uid(all_ids) * * .
}
}
}
This is how I am querying the graph recursively which is working fine:
{
query(func: type(Branch)) {
uid
state
created
text
type: dgraph.type
child_groups {
uid
state
created
text
type: dgraph.type
BRC as branches
}
}
rq(func: uid(BRC)) @recurse {
uid
created
state
text
type:dgraph.type
child_groups
branches
}
}
Response:
{
"data": {
"query": [
{
"uid": "0x1",
"state": 14600,
"created": "1969-12-31T18:00:00Z",
"text": "string",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x2"
}
]
},
{
"uid": "0x2711",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string 2",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x2712",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string",
"type": [
"Group"
]
}
]
},
{
"uid": "0x2713",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string 2",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x2718",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string",
"type": [
"Group"
]
},
{
"uid": "0x9c41",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string",
"type": [
"Group"
]
},
{
"uid": "0x9c42",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string",
"type": [
"Group"
]
}
]
},
{
"uid": "0x2714",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string 2",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x4e21",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string",
"type": [
"Group"
]
},
{
"uid": "0x4e22",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string",
"type": [
"Group"
]
}
]
},
{
"uid": "0x2715",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string 2",
"type": [
"Branch"
]
},
{
"uid": "0x2716",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string 2",
"type": [
"Branch"
]
},
{
"uid": "0x2717",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string 2",
"type": [
"Branch"
]
},
{
"uid": "0x4e23",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "string child",
"type": [
"Branch"
]
},
{
"uid": "0x4e24",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "another string child",
"type": [
"Branch"
]
},
{
"uid": "0x4e25",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "another string child",
"type": [
"Branch"
]
},
{
"uid": "0x4e26",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "another string child one more",
"type": [
"Branch"
]
},
{
"uid": "0x7531",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "A new branch",
"type": [
"Branch"
]
},
{
"uid": "0x7532",
"state": 172800,
"created": "1970-01-02T18:00:00Z",
"text": "another branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c43",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "A Root Branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x9c44",
"state": 1468800,
"created": "1970-01-17T18:00:00Z",
"text": "First level group",
"type": [
"Group"
]
}
]
},
{
"uid": "0x9c45",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "first branch of first group",
"type": [
"Branch"
]
},
{
"uid": "0x9c46",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "One more branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x9c47",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "A new group for child branch",
"type": [
"Group"
]
}
]
},
{
"uid": "0x9c48",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "third branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x9c49"
}
]
},
{
"uid": "0x9c4a",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "A new branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0xc351",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "A new group",
"type": [
"Group"
]
}
]
},
{
"uid": "0x9c4b",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "another branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c4c",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "Another branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c4d",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "another b",
"type": [
"Branch"
]
},
{
"uid": "0x9c4e",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "fifth branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c4f",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "sixth branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c50",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "seventh branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c51",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "eight branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c52",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "ninth branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x9c55",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "a group for y",
"type": [
"Group"
]
}
]
},
{
"uid": "0x9c53",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "tenth branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x9c54",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "new group",
"type": [
"Group"
]
}
]
},
{
"uid": "0xc352",
"state": 0,
"created": "1969-12-31T18:00:00Z",
"text": "A new branch for uz0",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0xc353",
"state": 0,
"created": "2023-04-20T06:19:33.367238Z",
"text": "abcdef",
"type": [
"Group"
]
}
]
}
],
"rq": [
{
"uid": "0x2713",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string 2",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x2718",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string",
"type": [
"Group"
],
"branches": [
{
"uid": "0x4e23",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string child",
"type": [
"Branch"
]
},
{
"uid": "0x4e24",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "another string child",
"type": [
"Branch"
]
},
{
"uid": "0x4e25",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "another string child",
"type": [
"Branch"
]
},
{
"uid": "0x4e26",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "another string child one more",
"type": [
"Branch"
]
}
]
},
{
"uid": "0x9c41",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string",
"type": [
"Group"
]
},
{
"uid": "0x9c42",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string",
"type": [
"Group"
]
}
]
},
{
"uid": "0x2714",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string 2",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x4e21",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string",
"type": [
"Group"
]
},
{
"uid": "0x4e22",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string",
"type": [
"Group"
]
}
]
},
{
"uid": "0x2715",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string 2",
"type": [
"Branch"
]
},
{
"uid": "0x2716",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string 2",
"type": [
"Branch"
]
},
{
"uid": "0x2717",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string 2",
"type": [
"Branch"
]
},
{
"uid": "0x4e23",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "string child",
"type": [
"Branch"
]
},
{
"uid": "0x4e24",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "another string child",
"type": [
"Branch"
]
},
{
"uid": "0x4e25",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "another string child",
"type": [
"Branch"
]
},
{
"uid": "0x4e26",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "another string child one more",
"type": [
"Branch"
]
},
{
"uid": "0x7531",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "A new branch",
"type": [
"Branch"
]
},
{
"uid": "0x7532",
"created": "1970-01-02T18:00:00Z",
"state": 172800,
"text": "another branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c45",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "first branch of first group",
"type": [
"Branch"
]
},
{
"uid": "0x9c46",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "One more branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x9c47",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "A new group for child branch",
"type": [
"Group"
]
}
]
},
{
"uid": "0x9c48",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "third branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x9c49",
"branches": [
{
"uid": "0x9c4a",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "A new branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c4b",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "another branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c4c",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "Another branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c4d",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "another b",
"type": [
"Branch"
]
},
{
"uid": "0x9c4e",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "fifth branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c4f",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "sixth branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c50",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "seventh branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c51",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "eight branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c52",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "ninth branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c53",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "tenth branch",
"type": [
"Branch"
]
}
]
}
]
},
{
"uid": "0x9c4a",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "A new branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0xc351",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "A new group",
"type": [
"Group"
]
}
]
},
{
"uid": "0x9c4b",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "another branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c4c",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "Another branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c4d",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "another b",
"type": [
"Branch"
]
},
{
"uid": "0x9c4e",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "fifth branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c4f",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "sixth branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c50",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "seventh branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c51",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "eight branch",
"type": [
"Branch"
]
},
{
"uid": "0x9c52",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "ninth branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x9c55",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "a group for y",
"type": [
"Group"
]
}
]
},
{
"uid": "0x9c53",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "tenth branch",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0x9c54",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "new group",
"type": [
"Group"
],
"branches": [
{
"uid": "0xc352",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "A new branch for uz0",
"type": [
"Branch"
]
}
]
}
]
},
{
"uid": "0xc352",
"created": "1969-12-31T18:00:00Z",
"state": 0,
"text": "A new branch for uz0",
"type": [
"Branch"
],
"child_groups": [
{
"uid": "0xc353",
"created": "2023-04-20T06:19:33.367238Z",
"state": 0,
"text": "abcdef",
"type": [
"Group"
]
}
]
}
]
},
"extensions": {
"server_latency": {
"parsing_ns": 46197,
"processing_ns": 2072280,
"encoding_ns": 210476,
"assign_timestamp_ns": 346146,
"total_ns": 2756753
},
"txn": {
"start_ts": 140054
},
"metrics": {
"num_uids": {
"": 0,
"_total": 609,
"branches": 65,
"child_groups": 79,
"created": 93,
"dgraph.type": 93,
"state": 93,
"text": 93,
"uid": 93
}
}
}
}