Type-Safe GraphQL Servers with GADTs
Generalized algebraic datatypes (GADTs) are often considered an exotic academic curiosity with no bearing in practical applications. In this talk, we’ll explore how to apply GADTs to a real-world problem: implementing a simple GraphQL server. In that process we’ll demonstrate how GADTs allow us to model the problem domain accurately in the type system. As a result, we can get many compile-time guarantees that is typically solved with runtime checks and type coercions in other libraries. Examples will be in OCaml.