absinthe-expert

Build Absinthe-based GraphQL APIs in Elixir with resolver and middleware patterns.

2|1|Updated Feb 8, 2021
One-click install
npx skills add https://github.com/jstoobz/dotfiles --skill absinthe-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: absinthe-expert
Source: https://github.com/jstoobz/dotfiles/tree/main/claude/skills/elixir/absinthe-expert
Command: npx skills add https://github.com/jstoobz/dotfiles --skill absinthe-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a structured approach to building robust Absinthe-based GraphQL APIs in Elixir, covering architecture, resolver patterns, middleware, and testing practices to reduce boilerplate and improve maintainability.

Core Features & Use Cases

  • Resolver patterns for single-entity lookups, lists with filtering, and nested associations via Dataloader to prevent N+1 queries.
  • Middleware and plugin strategies to enforce authentication, authorization, and error handling across GraphQL operations.
  • Schema design guidance, Dataloader integration, and comprehensive testing approaches for Absinthe-powered APIs.

Quick Start

Install an Elixir/Phoenix project, add Absinthe dependencies, and scaffold a minimal Absinthe schema following the patterns described. Then write and run tests to validate resolvers and middleware behavior.

Frequently Asked Questions about absinthe-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent N+1 queries in Absinthe GraphQL when fetching nested associations?

Absinthe GraphQL resolver patterns define single-entity lookups, filtered lists, and nested associations via Dataloader to prevent N+1 queries. This structured approach batches data requests, avoiding repeated database calls during nested resolver execution.

How do I add authentication and authorization middleware to an Absinthe GraphQL schema?

You add authentication and authorization to an Absinthe GraphQL schema by implementing custom middleware. These middleware strategies intercept GraphQL operations to enforce access control and handle errors consistently across all requests.

What is the best way to structure resolver patterns in Elixir Phoenix GraphQL APIs?

The best way to structure resolver patterns in Elixir Phoenix GraphQL APIs involves separating single-entity lookups, filtered list queries, and nested associations. Using Dataloader for associated data reduces boilerplate and improves maintainability.

How do I test Absinthe GraphQL resolvers and middleware behavior in Elixir?

You test Absinthe GraphQL resolvers and middleware behavior by writing comprehensive test suites that validate resolver outputs and middleware authorization rules. This ensures reliable test coverage for GraphQL APIs within your Elixir Phoenix project.

Does this Absinthe GraphQL approach require an existing Phoenix project setup?

Yes, this Absinthe GraphQL approach targets Phoenix-based Elixir projects. You need an existing Elixir and Phoenix environment to add Absinthe dependencies, scaffold a minimal schema, and implement the robust data fetching patterns.