You can use GET /me/mailFolders/{id}/childFolders
to get a MailFolder and Sub Folders also in single API call.
For example: There is a subfolder present in my inbox, Using the below API we can get the SubFolder-id:
https://graph.microsoft.com/v1.0/me/mailFolders/inbox/childFolders
After this use the SubFolder-id in the below API to get subfolders present in that Folder.
https://graph.microsoft.com/v1.0/me/mailFolders/{SubFolder-id}/childFolders
Similarly you can traverse through all subfolders.
Further you can refer to these similar posts-
Hope this helps,
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".