Closed alexandru-calinoiu closed 2 years ago
It looks like the way to go. It takes advantage of what GraphQL offers over REST, we don't over fetch data and we minimize the number of API calls. It decouples more the feature modules. Now that we have to repeat ourselves a little is not that much of an inconvenient if we take into consideration the benefits of the approach.
What does it fix?
This is a POC (prove of concept) for data access, it will add api integration for the discovery screen.
To kick start discussions I will try to walk you through my thought process.
common/ui/models/LessonTheme
should have no idea about the underlying datasource, it should only exist so that thecomposable/LessonThemesItem
can be evolved without actually carrying about the api.One might think that with this approach there might be some duplication, this indeed can happen, I need themes both in the
home
andlearn
feature, so this means I will write the same query twice? You can very well write the same query twice, but this approach allows you to write only one query in the home screen that will bring bothlessons
andthemes
saving a trip to the api.TL;TR: developers should be able to work in parallel and isolation to ui composables and any feature module
How has it been tested?
TODO: