GraphQL implementation for Elixir
open sourceMITfree
Absinthe is a GraphQL implementation for Elixir, aiming at the complete GraphQL working draft with an idiomatic API. Schemas are written with macros that are built and checked at compile time, and the whole query pipeline (parser, validations, resolution) can be configured or swapped, even per document. It resolves fields asynchronously and in batches to avoid N+1 queries, analyses and limits query complexity, supports precompiled documents, and translates Elixir's snake_case to camelCase for clients. It has dedicated support for Phoenix and Plug on the server and Relay on the client.
Problems it solves
- build a GraphQL API in my Elixir Phoenix app
- stop my GraphQL resolvers from running one database query per item
- limit how expensive a GraphQL query clients can send
- expose camelCase fields to the frontend while writing snake_case Elixir
Features
- schemas defined with macros, built and verified at compile time
- configurable query pipeline: parser, validations and resolution
- asynchronous and batched field resolution against N+1 queries
- query complexity analysis and limits
- precompiled documents
- snake_case to camelCase translation
- Phoenix, Plug and Relay support
- Mix tasks to extract schema metadata
