Dev Mode
The Problem
Section titled “The Problem”When a schema uses inject_params (e.g., tenant_id from JWT), all queries fail locally without a valid JWT. This blocks local iteration, testing, and introspection — you need JWT infrastructure just to run a simple query.
Enabling Dev Mode
Section titled “Enabling Dev Mode”Via TOML
Section titled “Via TOML”[dev]enabled = truedefault_claims = { tenant_id = "dev-tenant", sub = "dev-user" }Via CLI flag
Section titled “Via CLI flag”fraiseql run --dev-claims '{"tenant_id": "dev-tenant", "sub": "dev-user"}'Via environment variable
Section titled “Via environment variable”FRAISEQL_ENV=development fraiseql runWhen using the environment variable, set default claims separately:
FRAISEQL_ENV=development \FRAISEQL_DEV_CLAIMS='{"tenant_id": "dev-tenant", "sub": "dev-user"}' \fraiseql runHow It Works
Section titled “How It Works”- When
[dev].enabled = trueand no JWT is present in the request, FraiseQL constructs aSecurityContextfromdefault_claims - When a valid JWT is present, it takes precedence — dev defaults are ignored
inject_paramsresolve normally against the synthesized claims
Precedence
Section titled “Precedence”- Valid JWT in request → real claims used (always)
- No JWT + dev mode enabled →
default_claimsused - No JWT + dev mode disabled → validation error (production behavior)
Docker Compose Example
Section titled “Docker Compose Example”services: fraiseql: image: ghcr.io/fraiseql/server:latest environment: DATABASE_URL: postgresql://postgres:password@db:5432/mydb FRAISEQL_ENV: development FRAISEQL_DEV_CLAIMS: '{"tenant_id": "dev-tenant", "sub": "dev-user"}' ports: - "8080:8080"Security Guardrails
Section titled “Security Guardrails”- The server logs a WARNING on startup when dev mode is active
- The
/healthendpoint includes"dev_mode": truewhen enabled FRAISEQL_ENV=productionexplicitly disables dev mode regardless of TOML settings
When NOT to Use Dev Mode
Section titled “When NOT to Use Dev Mode”- Staging environments — use real JWT infrastructure instead
- CI pipelines testing auth flows — test against real auth to catch regressions
- Any environment accessible outside localhost
Next Steps
Section titled “Next Steps” Deployment Guide Production deployment with secure defaults and environment configuration.
TOML Configuration Reference Full reference for fraiseql.toml including dev mode settings.
Testing Guide Integration testing strategies with and without dev mode.