Documentation
gqlith is a build-time generator that turns a Postgres schema into a GraphQL, REST and MCP API — one permission model across all three, emitted as TypeScript you own. Unlike a runtime engine, the generated server has no gqlith dependency: uninstall the generator and your API keeps serving. Start with the overview, then dive into the annotation cheatsheet or the filtering grammar. One page per protocol covers the operation shapes specific to GraphQL, REST and MCP.
Start here
Reference
Protocols
-
GraphQL surface
Generate a GraphQL API from your Postgres schema — queries, mutations, subscriptions, aggregates, batch ops and nested writes, governed by the shared permission model.
-
REST surface
Generate a REST API from Postgres — JSON:API 1.1 with sparse fieldsets, compound include, FiltrQL on the query string, aggregates, actions, ETag / If-Match.
-
MCP surface
Generate an MCP server from Postgres — four governed tools that make the API self-describing to AI agents, permission-projected so an agent only ever learns what the caller can see.
-
TypeScript client SDK
Generate a fully-typed, fluent TypeScript client alongside the API — selection-inferred return types, typed writes, aggregates, subscriptions and a TanStack Query binding.
Batteries
-
File storage
Governed file uploads from Postgres annotations — direct-to-store uploads with mint/confirm, signed downloads, image variants, quotas, lifecycle GC and S3 / R2 / GCS adapters.
-
Database-layer security
Defense in depth from the same annotations — JWT claims propagated to Postgres GUCs and generated RLS policies, so the database enforces what the API enforces.
-
Custom fields
Tenant-definable custom fields, generated — a governed catalog, typed values, inline atomic writes, filtering and sorting, discoverable on GraphQL, REST and MCP.
-
Typed JSONB
Declare a JSONB column's shape once with @gqlith.jsonSchema — get real GraphQL types, validated writes, typed filtering and ordering, optional CHECK constraints, and a drift-check CLI.
-
Webhooks, queues & crons
React to data changes with durable, transactional delivery; receive verified inbound webhooks; send signed outgoing webhooks; run scheduled jobs — on Cloudflare, AWS or plain Postgres transports.