GraphQL API
Query persisted Person records without authentication.
The single API endpoint is /api/graphql. It accepts queries over GET or POST.
GraphiQL is available at that endpoint in development, not production.
Example
query People {
people {
id
name
email
}
}The query returns up to 100 records from demo.person, ordered by name and ID.
Compose seeds three fictional examples, including:
{
"id": "00000000-0000-4000-8000-000000000001",
"name": "Alex Morgan",
"email": "alex@example.com"
}The GraphQL response wraps the records in {"data":{"people":[...]}}.
Set APP_URL to the URL printed by make dev or make worktree-up:
curl "$APP_URL/api/graphql" \
-H 'Content-Type: application/json' \
--data '{"query":"query People { people { id name email } }"}'Extend the contract
- Edit
backend/src/graphql/schema.tsandweb/src/graphql/operations.graphql. - Run
make codegento generate resolver and operation types. - Update the resolver and native Drizzle query.
- Update the frontend and tests, then run
make checkandmake test.
Do not edit generated files by hand. CI checks for code generation drift.
This demo has no authentication. Never store private people data in this example. Add authentication, authorization, validation, and suitable query limits before introducing private data or expensive operations. There are no mutations yet.