ryanw-mobile / OctoMeter

🔥Kotlin Multiplatform Desktop/Android/iOS Energy Tracker app
Other
115 stars 10 forks source link

Account screen: Migrate to GraphQL #274

Closed ryanw-mobile closed 1 month ago

ryanw-mobile commented 1 month ago

We have figured out the exact GraphQL query that returns the same data we had with the RestAPI. Safe to proceed now.

We might as well add to show the account balance and/or other interesting data from the GraphQL endpoint, too.

ryanw-mobile commented 1 month ago

Although it is imperfect to keep a hybrid (RestAPI & GraphQL) implementation in the project, with the help of ChatGPT to scan the GraphQL schema, there is no way for guest users to check tariff half-hourly rates, and for authenticated users to check half-hourly rates for the tariffs not appearing in their contracts.

Therefore, the agile screen and the usage screen will remain RestAPI - while the traffs and account should be safe to use GraphQL.

That means this ticket would round up the migration - with the authentication/token handling included.

We may/may not further refactor the code in this ticket to settle down the changes.