Configuration

Config

Most commands in Axolotl read options from a config file in your project root (axolotl.json). To create/update it and generate models, run:

npx axolotl build

The -m/--models and -s/--schema flags are supported; if omitted, the CLI prompts for paths and saves them into axolotl.json for future runs.

Based on the beerpub-yoga example run axolotl build:

Axolotl writes axolotl.json with the paths used to build models. Example:

axolotl.json
{
  "schema": "schema.graphql",
  "models": "src/models.ts"
}

This guide should help you understand your Axolotl configuration. See Examples for end‑to‑end setups.

Micro federation

Config supports built‑in micro‑federation. When federation is provided, the CLI:

  1. generates models for each subgraph,
  2. merges schemas into a supergraph saved at schema,
  3. generates supergraph models.

See the yoga-federated example.

axolotl.json
{
    "schema": "schema.graphql",
    "models": "src/models.ts",
    "federation":[
        {
            "schema":"src/beers/schema.graphql",
            "models":"src/beers/models.ts"
        },
        {
            "schema":"src/shop/schema.graphql",
            "models":"src/shop/models.ts"
        }
    ]
}