# Blog post about achieving various kinds of backend-to-frontend type safety in an Elm/Phoenix app

**URL:** <https://discourse.elm-lang.org/t/blog-post-about-achieving-various-kinds-of-backend-to-frontend-type-safety-in-an-elm-phoenix-app/9964>\
**Category:** Show and Tell\
**Created:** [September 13, 2024, 6:33pm UTC](https://discourse.elm-lang.org/t/blog-post-about-achieving-various-kinds-of-backend-to-frontend-type-safety-in-an-elm-phoenix-app/9964 "2024-09-13T18:33:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![neurodynamic](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/neurodynamic/32/984_2.png) [@neurodynamic](https://discourse.elm-lang.org/u/neurodynamic)\
**Post date:** [September 13, 2024, 6:33pm UTC](https://discourse.elm-lang.org/t/blog-post-about-achieving-various-kinds-of-backend-to-frontend-type-safety-in-an-elm-phoenix-app/9964/1 "2024-09-13T18:33:41Z")

</div>

Hey, I haven’t been around here much lately, but I wanted to share [a blog post I finally got around to writing](https://www.neurodynamic.online/writing/frontend-to-backend-type-safety) 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](https://github.com/dillonkearns/elm-graphql), [elm-ts-interop](https://elm-ts-interop.com/), 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)](https://www.neurodynamic.online/writing/frontend-to-backend-type-safety)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [September 23, 2024, 6:33pm UTC](https://discourse.elm-lang.org/t/blog-post-about-achieving-various-kinds-of-backend-to-frontend-type-safety-in-an-elm-phoenix-app/9964/2 "2024-09-23T18:33:51Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
