absinthe-schema
Use when designing GraphQL schemas with Absinthe. Covers type definitions, interfaces, unions, enums, and schema organization patterns.
Best use case
absinthe-schema is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when designing GraphQL schemas with Absinthe. Covers type definitions, interfaces, unions, enums, and schema organization patterns.
Teams using absinthe-schema should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/absinthe-schema/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How absinthe-schema Compares
| Feature / Agent | absinthe-schema | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when designing GraphQL schemas with Absinthe. Covers type definitions, interfaces, unions, enums, and schema organization patterns.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Absinthe - Schema Design
Comprehensive guide to designing GraphQL schemas with Absinthe in Elixir.
## Key Concepts
### Type Definitions
```elixir
defmodule MyApp.Schema.Types do
use Absinthe.Schema.Notation
object :user do
field :id, non_null(:id)
field :name, non_null(:string)
field :email, :string
field :posts, list_of(:post) do
resolve &MyApp.Resolvers.User.posts/3
end
field :inserted_at, :datetime
end
object :post do
field :id, non_null(:id)
field :title, non_null(:string)
field :body, :string
field :author, :user do
resolve &MyApp.Resolvers.Post.author/3
end
end
end
```
### Interfaces
```elixir
interface :node do
field :id, non_null(:id)
resolve_type fn
%MyApp.User{}, _ -> :user
%MyApp.Post{}, _ -> :post
_, _ -> nil
end
end
object :user do
interface :node
field :id, non_null(:id)
field :name, non_null(:string)
end
```
### Unions
```elixir
union :search_result do
types [:user, :post, :comment]
resolve_type fn
%MyApp.User{}, _ -> :user
%MyApp.Post{}, _ -> :post
%MyApp.Comment{}, _ -> :comment
_, _ -> nil
end
end
```
### Enums
```elixir
enum :post_status do
value :draft, as: "draft"
value :published, as: "published"
value :archived, as: "archived"
end
```
### Input Objects
```elixir
input_object :create_post_input do
field :title, non_null(:string)
field :body, :string
field :status, :post_status, default_value: :draft
end
```
## Best Practices
1. **Organize types by domain** - Group related types in separate modules
2. **Use non_null sparingly** - Only for truly required fields
3. **Leverage interfaces** - For shared fields across types
4. **Define input objects** - For complex mutation arguments
5. **Use custom scalars** - For dates, UUIDs, JSON, etc.
## Schema Organization
```elixir
defmodule MyApp.Schema do
use Absinthe.Schema
import_types MyApp.Schema.Types
import_types MyApp.Schema.Queries
import_types MyApp.Schema.Mutations
import_types MyApp.Schema.Subscriptions
import_types Absinthe.Type.Custom # DateTime, etc.
query do
import_fields :user_queries
import_fields :post_queries
end
mutation do
import_fields :user_mutations
import_fields :post_mutations
end
subscription do
import_fields :post_subscriptions
end
end
```
## Custom Scalars
```elixir
scalar :uuid, name: "UUID" do
serialize &to_string/1
parse &parse_uuid/1
end
defp parse_uuid(%Absinthe.Blueprint.Input.String{value: value}) do
case Ecto.UUID.cast(value) do
{:ok, uuid} -> {:ok, uuid}
:error -> :error
end
end
defp parse_uuid(_), do: :error
```
## Anti-Patterns
- Avoid deeply nested types without pagination
- Don't expose database IDs directly without consideration
- Avoid circular dependencies in type definitions
- Don't skip field descriptions for documentationRelated Skills
adf-format-json-schema
Query Atlassian Document Format (ADF) JSON schema definitions to understand ADF node and mark types. Use this skill when implementing ADF dataclass nodes/marks, or when user asks about ADF structure, ADF nodes, ADF marks, or Atlassian Document Format implementation.
add-malli-schemas
Efficiently add Malli schemas to API endpoints in the Metabase codebase with proper patterns, validation timing, and error handling
absinthe-subscriptions
Use when implementing real-time GraphQL subscriptions with Absinthe. Covers Phoenix channels, PubSub, and subscription patterns.
absinthe-resolvers
Use when implementing GraphQL resolvers with Absinthe. Covers resolver patterns, dataloader integration, batching, and error handling.
lets-go-rss
A lightweight, full-platform RSS subscription manager that aggregates content from YouTube, Vimeo, Behance, Twitter/X, and Chinese platforms like Bilibili, Weibo, and Douyin, featuring deduplication and AI smart classification.
chrome-debug
This skill empowers AI agents to debug web applications and inspect browser behavior using the Chrome DevTools Protocol (CDP), offering both collaborative (headful) and automated (headless) modes.
grail-miner
This skill assists in setting up, managing, and optimizing Grail miners on Bittensor Subnet 81, handling tasks like environment configuration, R2 storage, model checkpoint management, and performance tuning.
whisper-transcribe
Transcribes audio and video files to text using OpenAI's Whisper CLI, enhanced with contextual grounding from local markdown files for improved accuracy.
ontopo
An AI agent skill to search for Israeli restaurants, check table availability, view menus, and retrieve booking links via the Ontopo platform, acting as an unofficial interface to its data.
ux
This AI agent skill provides comprehensive guidance for creating professional and insightful User Experience (UX) designs, covering user research, information architecture, interaction design, visual guidance, and usability evaluation. It aims to produce actionable, user-centered solutions that avoid generic AI aesthetics.
thor-skills
An entry point and router for AI agents to manage various THOR-related cybersecurity tasks, including running scans, analyzing logs, troubleshooting, and maintenance.
modal-deployment
Run Python code in the cloud with serverless containers, GPUs, and autoscaling using Modal. This skill enables agents to generate code for deploying ML models, running batch jobs, serving APIs, and scaling compute-intensive workloads.