code4romania / teacher-workout-android

Teacher Workout Android app
Mozilla Public License 2.0
5 stars 17 forks source link

Data access POC (discussion) #50

Closed alexandru-calinoiu closed 2 years ago

alexandru-calinoiu commented 2 years ago

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.

One might think that with this approach there might be some duplication, this indeed can happen, I need themes both in the home and learn 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 both lessons and themes 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:

daniyelp commented 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.