Also, if the height of your graph is constant, you could do it in a query with something like:
{
tree(func: eq(name, "bob")) {
child { expand(_all_) { expand(_all_) { expand(_all_) { expand(_all_) }}}}
parent
name
}
}
Again, this wouldn’t work if the number of expand(all) statements needed is not the same for every node but I am mentioning this in case it fits your use case.