We write a ton of GraphQL at Vendr (and at Blissfully before we were acquired by Vendr), and this tool has been in production for over a year. It’s been a huge productivity booster for us and we can’t wait to see the Elm community reap the benefits as well.
This also uses —and was one of the prime motivators for— Elm Codegen.
This also represents Vendr’s first official foray into contributing to open source for Elm.
Nice to have a billion dollar company at your back.
Move fast, break nothing.
Writing GraphQL directly means you can move very fast, you can use whatever editor plugins you prefer, and have access to autocomplete and all kinds of other goodies.
But there’s no compromise here with typesafety.
In fact we found that there are other strong benefits to having .graphql queries live in your code — it provides an easy on-ramp for backend programmers who aren’t as familiar with Elm to just jump in! And you have an easy way to audit exactly what data is being requested, which is huge for right-sizing data requests.
A backend programmer’s most common interaction with the frontend is usually something to do with the data layer, so if their first interaction with Elm is requiring them to read and write decoders, it’s a little rough . Fortunately this gets around that because you get decoders for free.
I’m currently using ports to query and subscribe to a Hasura GraphQL API for konsens.it. I will give elm-gql a spin for the queries and will probably be in touch for the subscriptions once this is working well.