# Axolotl Schema

> Schema-first development, @resolver directive, models generation, resolver boilerplate scaffolding, CLI commands, and inspect tool Use when this capability is needed.

- Skill: `tomevault-io/axolotl-schema` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/axolotl-schema`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/axolotl-schema/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/axolotl-schema

---


## Rules

- Write schema in `.graphql` files → run `axolotl build` → types generated in `models.ts`
- **NEVER edit `models.ts` manually** — always overwritten by `axolotl build`
- `@resolver` marks fields requiring a resolver implementation
- Each federation module has its own `.graphql`; `axolotl build` merges them into `backend/schema.graphql`
- **No `extend type`** — Axolotl merges types by name. Use plain `type` declarations.
- Always use `.js` extensions in imports (ESM)

## `@resolver` Directive

```graphql
directive @resolver on FIELD_DEFINITION

type Query {
  user: AuthorizedUserQuery @resolver # needs resolver
  hello: String! # no @resolver — resolved inline
}
```

`axolotl resolvers` scaffolds files only for `@resolver` fields.

## CLI Commands

| Command                                                                          | Effect                                                           |
| -------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `cd backend && npx @aexol/axolotl build`                                         | Merge schemas → regenerate `models.ts` + Zeus client             |
| `cd backend && npx @aexol/axolotl resolvers`                                     | Scaffold resolver files for `@resolver` fields (non-destructive) |
| `cd backend && npx @aexol/axolotl inspect -s schema.graphql -r lib/resolvers.js` | Report unimplemented `@resolver` fields                          |

## Federation Schema Pattern

```graphql
# src/modules/users/schema.graphql
directive @resolver on FIELD_DEFINITION

type AuthorizedUserQuery {
  me: User @resolver
}
```

Declare `type` with same name across modules — `axolotl build` merges fields. `axolotl.json` lists all module schemas under `federation[]`.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/aexol-studio) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

