Absinthe subscriptions with ReasonML and Urql

Lately I've been looking into ReasonML as a language to pick up. In the past I've dabbled with Elm and really enjoyed it but it's lack of interoperability with javascript hampers its development. ReasonML offers a far better story in this regards, there are excellent React and React-Native libraries/bindings available as well as bindings for popular Graphql clients. That, combinated with great type-safety makes it a compelling alternative to Elm and Typescript. »

Urql graphql subscriptions with Absinthe

Many Graphql stacks use Apollo as the javascript client library. It's well maintained, popular and has lot's of examples. It also works together with Absinthe, the Elixir Graphql library. If you need to use graphql subscriptions in combination with Apollo and Absinthe there is the socket-apollo-link to connect the two. There's another interesting javascript client library for Graphql on the horizon, Urql. It's a bit more lightweight and looks really promising. »

Using serverless Ruby on AWS Lambda to resize images

At the last AWS ReInvent, it was announced that AWS Lambda would support Ruby as a runtime language. I was eager to try this out, Ruby's powerful syntax and features are a joy to work with and coupling this with AWS Lambda I figured it could be leveraged for some easy image resizing Lambda. I started off with the serverless framework as this is an easy way provision Lambda functions. The goal is that when an image is uploaded to an S3 bucket, a Lambda is started, it resizes the image, and then uploads it to another bucket. »

Writing your own Absinthe DSL with macros and middleware

Absinthe is a great library to do graphql in Elixir. However, when writing your resolvers you may find that you are writing some boilerplate multiple times. So, in the spirit of keeping your code DRY, in this post I'll show how we can leverage middleware and a macro to write your own DSL for your Graphql api. I assume some basic knowledge on how Absinthe works, most of the information can be found on in the guides »

Writing an Absinthe Phase

Absinthe does a lot when you fire a GraphQL query at it. The incoming query is parsed into an internal representation, validated and finally executed. This process is done by phases, these are individual modules chained together in a pipeline that each do a single step in processing the queries. Phases in Absinthe do a lot of work. They are the building blocks in validating and executing the GraphQL query. E. »

Absinthe Tips and Tricks

Absinthe is a great package for building GraphQL api's in Elixir. It is fast, good DSL and overall great implementation of the GraphQL spec for servers. Working with Absinthe I've come across some patterns that have helped clean up code. I'd like to share some of them here. The Self function Imagine you have an image object you want to expose, and for each image you want a separate object with just the dimensions of the image. »

Looking back at year in tech

Retrospective Last year was an interesting year for me. I was able to try out a whole lot of new technologies, assess their capabilities and get a good look at their pros and cons. I want to go over a couple of them, and shortly summarize my findings. Typescript In short, Typescript made Javascript fun for me again. Although a lot of this can be attributed to the support of ES6/ES7 in Typescript. »

Upgrading Phoenix to Http2

Upgrading phoenix framework to serve http2 Http2 is the next version of the http protocol and offers several advantages. It serves over a single connection, reducing the number of roundtrips necessary. With multiplexing it can handle multiple requests at the same time and as a whole is just better. As the internet slowly moves to support http2, Phoenix does not lag behind. The webserver Phoenix uses, Cowboy, has released version 2 with support for http2 and the updates to Phoenix and Plug have followed in its path. »

Using Elm within VueJS

Using Elm within VueJS Lately I have been using VueJS a lot. It's an easy framework to learn and gets results quickly. There is an optional Typescript package to get some much needed typesafety. Overall, I'm pretty happy with it. However, the templates in Vue are where the typesafety breaks down. Typescript just has no way of knowing what's happening in there, whereas it does have support for JSX/TXS and will supply you with type information in e. »

Early look at Rails ActiveStorage

I took an early peek at the new Active Storage project in Rails 5.2. It is a built-in solution to handling uploads, something that is all to common in web applications. Also something that is covered by quite a few gems, CarrierWave, PaperClip and Refile for example. These are just the ones I know off the top of my head. At times I have also handled uploads without gems, it's not that difficult and didn't warrant the inclusion of another gem for those projects. »