Hey, I haven’t been around here much lately, but I wanted to share a blog post I finally got around to writing about getting type safety between various facets of the frontend and backend of an Elm/Phoenix app. The short version is I used a combination of elm-graphql, elm-ts-interop, some automatic-unit-test-generation code I wrote based on some ideas I got from elm-graphql, and some duplication of elm-graphql’s query aliasing code to get elm-graphql to work for html-embedded initialization data (aka flags) in addition to the API.
The longer version is in the blog post. It was a lot of work, but I’m really happy with the result. I hope people find it interesting. And shoutout to @dillonkearns without whose tools this would have been for all practical purposes impossible.
Here’s the post: How I Made an App with Guaranteed Type Safety Across the Frontend/Backend Divide (and everywhere else)