Automating API Busywork with Scala
summary
Scala code uses transparent traits (Scala 3) to infer precise union types for endpoint error sets, turning implementation errors into a machine-readable schema that gets auto-generated into Caliban schema generation files and checked in CI for regressions. Error handling uses ZIO IO and shows how to keep stack traces while preserving exact error unions. For response shape churn the Decurio library models domain relations as declarative selection trees, composes batched ZQuery-like fetches to avoid N+1, and emits runnable imperative code for local resolution. Demo repo included.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 2:50Error handling automation
- 7:42Error type inference
- 9:07GraphQL schema generation
- 11:54Extending schema automation
- 13:18Return type selection
- 17:57Selection tree churn
- 22:38Decurio for relations
- 25:27Declarative trees benefits
- 26:12Recap and Scala
related talks
30mNext Generation of Scala
34mDelimited dependently
49mBeautiful APIs with Scala, Scalatra, Swagger, and Akka
43mAPI first with Swagger and Scala
37mA Skeptic’s Look at scalaz’ Gateway Drugs: A Practical Exploration
36mScale By The Bay 2018 Unconference: Devon Stewart
29mA Skeptic's Look at Scalaz Gateway Drugs
39mA few tips on modelling things in Scala
