You're using the search endpoint to get all the items that match the criteria (everything in your case). If you want to enumerate the drive one level at a time then you'll need to use the children endpoint. The first example given returns the children of the root. For each child you can then call its list children endpoint to get its children (if it is a folder). In this way you can emulate how Windows Explorer works by retrieving the items only when needed.
Of course if you want all children at once then search is fine as making calls for every folder is expensive. Only load each folder on demand if you need that functionality. Also be aware that if you want to show an expand option for a folder but only if it has children then you'd technically need to load the root children and then the children of each root folder. Each time a child is expanded you would need to expand its child folders so you know whether it has any children to "expand". But that is only if you want to get fancy.