I have a set of API calls.
Some are plain calls, such as:
myapi.com/api/V1/students
myapi.com/api/V1/classes
And some are nested calls, such as:
myapi.com/api/V1/classes/{classID}/students
myapi.com/api/V1/students/{studentID}/grades
Every call might return limited response that should be paginated (not a standard pagination).
I need your help with the correct architecture for this - what is the most efficient way to build this solution?
For now:
I have built a Child flow that accepts any URL, does pagination and appends all the responses together.
I call for this flow from a Parent Flow that has api list.
I works fine for plain APIs: /classes and /students
When I started to think how do I approach nested calls, I stuck.
The logic will go like this (for example for classes/{classID}/students):
1. I need to get the list of all the classes first. Including Pagination.
2. Then for each class - I need to take its ID, and get all the students. Including Pagination.
I feel that I need to reuse my Child flow inside itself.
I just don't want to recreate all the logic again
Please help