Configuration
Baeta is configured through a single file at the project root.
Configuration file
Baeta looks for a file named baeta or .baeta with any of these extensions, in the working directory:
.ts,.mts.js,.mjs
note
The config file must be ESM. For .ts/.js, set "type": "module" in package.json; otherwise use the .mts or .mjs extension.
Minimum config
1. Point at your schemas
import { defineConfig } from "@baeta/cli";
export default defineConfig({
graphql: {
schemas: ["src/**/*.gql"],
},
});
2. Wire up package.json scripts
{
"scripts": {
"build": "baeta generate",
"start": "baeta generate --watch --run='node --watch --inspect src/app.ts'",
"types": "tsc --noEmit"
}
}
What these do:
- build — generates GraphQL types and module typedefs from your schema files.
- start — runs the generator in watch mode and launches the app alongside it via
--run. The--runprocess is long-lived: Baeta starts it once and only respawns it if it exits. Live reload comes fromnode --watchinside--run, which restarts the app when source files (including the typedefs Baeta regenerates) change. - types — typechecks without emitting. Use it in CI.
tip
If you're using Bun or Deno you can replace start with either:
{
"start:bun": "baeta generate --watch --run='bun --watch --inspect src/app.ts'",
"start:deno": "baeta generate --watch --run='deno --watch --inspect --allow-net --allow-read --allow-env src/app.ts'"
}
tip
Run baeta generate --help for the full flag list. --watch re-runs the generator on schema changes. --run='…' is launched once as a long-running process; Baeta won't kill it on each regenerate, so the inner command (typically node --watch / bun --watch / deno --watch) handles its own reloads.
Next
Create your first module. For the full set of config options, see the Configuration Reference.