GreenFairy
A cleaner DSL for GraphQL schema definitions built on Absinthe.
⚠️ Experimental: GreenFairy is in early development. The API may change between versions.
Features
- One module = one type — SOLID principles with auto-discovery
- CQL filtering — Hasura-style
whereandorderByon every connection - Multi-database — PostgreSQL, MySQL, SQLite, MSSQL, ClickHouse, Elasticsearch
- DataLoader — Batched association resolution built-in
- Relay — Cursor pagination, global IDs, Node interface
- Authorization — Type-owned field visibility
Installation
def deps do
[{:green_fairy, "~> 0.1.0"}]
endQuick Example
defmodule MyApp.GraphQL.Types.User do
use GreenFairy.Type
type "User", struct: MyApp.User do
field :id, non_null(:id)
field :name, :string
field :email, non_null(:string)
connection :posts, MyApp.GraphQL.Types.Post
end
endquery {
users(where: { email: { _ilike: "%@example.com" } }, first: 10) {
nodes { id name email }
pageInfo { hasNextPage endCursor }
}
}Documentation
- HexDocs — Full API documentation
- Getting Started — Installation and first schema
- CQL Guide — Filtering, sorting, multi-database
Links
License
MIT — see LICENSE
Contributing
See CONTRIBUTING.md for guidelines.