jutsu-absinthe-graphql
Absinthe GraphQL skills for Elixir covering schema design, resolvers, and real-time subscriptions.
- CCM score
- 45 of 100
- GitHub stars
- 201
Own this plugin? Claim it
What it does
- Adds 3 skills:
absinthe-schema,absinthe-resolvers, andabsinthe-subscriptionsfor Absinthe projects - Covers type definitions, interfaces, unions, enums, and schema organization for large APIs
- Guides resolver patterns with Dataloader batching and error handling, plus Phoenix channel and PubSub subscriptions
- Designed for Elixir projects on Elixir 1.14+, Absinthe 1.7+, and Phoenix 1.7+ when using subscriptions
Add marketplace
/plugin marketplace add TheBushidoCollective/hanRun it inside Claude Code once, then install the plugin below.
Install
/plugin install jutsu-absinthe-graphql@hanRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceAbsinthe - Resolvers
Guide to implementing efficient and maintainable resolvers in Absinthe.
Key Concepts
Basic Resolvers
defmodule MyApp.Resolvers.User do
alias MyApp.Accounts
def list_users(_parent, args, _resolution) do
{:ok, Accounts.list_users(args)}
end
def get_user(_parent, %{id: id}, _resolution) do
case Accounts.get_user(id) do
nil -> {:error, "User not found"}
user -> {:ok, user}
end
end
def create_user(_parent, %{input: input}, _resolution) do
case Accounts.create_user(input) do
{:ok, user} -> {:ok, user}
{:error, changeset} -> {:error, changeset}
end
end
end
Resolution Context
def current_user(_parent, _args, %{context: %{current_user: user}}) do
{:ok, user}
end
def current_user(_parent, _args, _resolution) do
{:error, "Not authenticated"}
end
Dataloader Integration
defmodule MyApp.Schema do
use Absinthe.Schema
def context(ctx) do
loader =
Dataloader.new()
|> Dataloader.add_source(MyApp.Repo, Dataloader.Ecto.new(MyApp.Repo))
Map.put(ctx, :loader, loader)
end
def plugins do
[Absinthe.Middleware.Dataloader] ++ Absinthe.Plugin.defaults()
end
end
# In type definitions
object :user do
field :posts, list_of(:post) do
resolve dataloader(MyApp.Repo)
end
end
Custom Dataloader Source
defmodule MyApp.Loaders.User do
def data() do
Dataloader.KV.new(&fetch/2)
end
defp fetch(:posts_count, user_ids) do
counts = MyApp.Posts.count_by_user_ids(user_ids)
Map.new(user_ids, fn id ->
{id, Map.get(counts, id, 0)}
end)
end
end
Best Practices
- Use Dataloader - Prevents N+1 queries
- Keep resolvers thin - Delegate to context modules
- Handle errors gracefully - Return meaningful error messages
- Use middleware - For cross-cutting concerns like auth
- Batch related queries - Use dataloader batching
Middleware
defmodule MyApp.Middleware.Auth do
@behaviour Absinthe.Middleware
def call(resolution, _config) do
case resolution.context do
%{current_user: %{}} ->
resolution
_ ->
resolution
|> Absinthe.Resolution.put_result({:error, "Unauthorized"})
end
end
end
# Apply to fields
field :admin_data, :string do
middleware MyApp.Middleware.Auth
resolve &MyApp.Resolvers.Admin.get_data/3
end
Error Handling
defmodule MyApp.Resolvers.Helpers do
def handle_changeset_errors(%Ecto.Changeset{} = changeset) do
errors =
Ecto.Changeset.traverse_errors(changeset, fn {msg, opts} ->
Enum.reduce(opts, msg, fn {key, value}, acc ->
String.replace(acc, "%{#{key}}", to_string(value))
end)
end)
{:error, errors}
end
end
Anti-Patterns
- Avoid business logic in resolvers
- Don't query database directly in resolvers
- Avoid returning raw Ecto changesets
- Don't skip error handling
Readme
Absinthe GraphQL
Absinthe GraphQL skills for Elixir projects with Claude Code.
What This Plugin Provides
Skills
This plugin provides the following skills for building GraphQL APIs with Absinthe:
- absinthe-schema: Type definitions, interfaces, unions, enums, and schema organization patterns
- absinthe-resolvers: Resolver patterns, Dataloader integration, batching, and error handling
- absinthe-subscriptions: Real-time subscriptions with Phoenix channels and PubSub
Installation
han plugin install absinthe-graphql
Usage
Once installed, Claude Code will have access to Absinthe-specific knowledge when working on Elixir GraphQL projects.
Example Use Cases
- Designing GraphQL schemas with proper type definitions
- Implementing efficient resolvers with Dataloader
- Setting up real-time subscriptions
- Handling authentication and authorization
- Organizing large schemas
Requirements
- Elixir 1.14+
- Absinthe 1.7+
- Phoenix 1.7+ (for subscriptions)
Related Plugins
- elixir: Core Elixir language skills
- phoenix: Phoenix framework patterns
- ecto: Database interactions with Ecto
- graphql: General GraphQL concepts
Details
- Marketplace
- TheBushidoCollective/han
- Source
- plugins/tools/absinthe-graphql
- Category
- Tool
- Keywords
- absinthe, graphql, elixir, api, subscriptions
- Listed since
- Apr 7, 2026
More from TheBushidoCollective/han
All 340- jutsu-act
- jutsu-agent-sdk
- jutsu-ameba
- jutsu-android
- jutsu-angular
- jutsu-ansible
- jutsu-apollo-graphql
- jutsu-atomic-design
- jutsu-bdd
- jutsu-biome
- jutsu-bun
- jutsu-c
- jutsu-checkstyle
- jutsu-clippy
- jutsu-cocoapods
- jutsu-cpp
- jutsu-credo
- jutsu-crystal
- jutsu-csharp
- jutsu-cucumber
- jutsu-cypress
- jutsu-dialyzer
- jutsu-django
- jutsu-docker-compose
Similar to jutsu-absinthe-graphql
More Backend & APIsabsinthe-graphqlPluginTheBushidoCollective/han201 starsAbsinthe GraphQL skills for Elixir with schema design, resolvers, and subscriptions.
jutsu-graphqlPluginTheBushidoCollective/han201 starsSkills for GraphQL schema design and queries.
graphql-operationsSkillapollographql/skills4K installsBest-practice guide for writing GraphQL queries, mutations, and fragments against a project's schema.
graphql-implementationSkillaj-geddes/useful-ai-prompts425 installsSchema design, resolver, and migration guidance for building GraphQL APIs with a best-practices checklist.
graphql-lspPluginPiebald-AI/claude-code-lsps520 starsGraphQL language server for schema and operation intelligence
apollo-skillsPluginanthropics/claude-plugins-official48.1K starsApollo GraphQL agent skills for Claude Code — Apollo Client, Server, Federation, Connectors, Router, Rover CLI, iOS, Kotlin, and the Apollo MCP server. Covers s