I am building a dynamic SOQL from a JSON file. As of now, I am able to build SOQL for direct parent and direct child objects dynamically. However, I am stuck at a complex/deep relationship.
E.g. object->Parent->child->so on. or object->Child->parent->so on.
I am okay with 2/3 level relationship(not expecting too deep). Is there way to achieve it dynamically(other than creating a recursive function, I am avoiding since I need to put some conditions on SOQL call, hence it will hard to keep track of conditions,which needs to be applied on that final(nested) object).