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. »

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. »