GraphQL pain
40 resolvers, N+1 debugging, and codegen eating your types.
MeshQL adds GraphQL-style field selection to REST. Clients ask for exactly what they need. You write one SQL query, return flat rows, and MeshQL shapes nested JSON — no resolver per field.
40 resolvers, N+1 debugging, and codegen eating your types.
Every client wants a different ?include= and you ship half the database.
Normal REST URLs. Query in headers. One resolver per entity. SQL you already write.
Published on JSR (@meshql/*) andnpm (meshql-*).
npm install meshql-core meshql-http meshql-client
npm i expressnpx jsr add @meshql/core @meshql/http @meshql/client
npm i expressNo database required for the first run — follow the5-minute guide or try theinteractive showcase.
GET /mesh/user/1
X-Mesh-Query: <base64 of the JSON below>
{
"user": {
"id": true,
"name": true,
"tokens": { "accessToken": true }
}
}// Shaped response
{
"user": {
"id": 1,
"name": "Ada Lovelace",
"tokens": [{ "accessToken": "tok_ada" }]
}
}Entities, fields, joins — one resolver per root entity.
JSON or QL in X-Mesh-Query. The SDK encodes it for you.
JoinPlan tells you what to fetch. Return flat SQL rows; get nested JSON.
Put that selection in X-Mesh-Query on the GET routes below (or in the body for POST /mesh).Reads and writes
GET/mesh/{entity}List — put selection in X-Mesh-QueryGET/mesh/{entity}/{id}One row — same headerPOST/meshComplex read — query in JSON bodyPUT/mesh/user/1Update scalars (+ optional $select)POST/mesh/user/1/tokensCreate many-childDELETE/mesh/user/1/tokens/42Delete many-childPUT/mesh/user/1/businessConnect one-relationDELETE/mesh/user/1/businessDisconnect one-relationFifteen focused libraries — install only what you need. Same semver on JSR and npm.
@meshql/coremeshql-core
Parser, planner, shaper, createMesh()
@meshql/sqlitemeshql-sqlite
buildSelectSql for node:sqlite, Bun, D1
@meshql/postgresmeshql-postgres
buildSelectSql with $1, $2 placeholders
@meshql/prismameshql-prisma
Prisma catch-all resolver — nested select
@meshql/drizzlemeshql-drizzle
Drizzle relational query resolver
@meshql/kyselymeshql-kysely
Kysely + buildSelectSql flat rows
@meshql/httpmeshql-http
Express, Fastify, and Hono adapters
@meshql/clientmeshql-client
Typed client — auth, lists, uploads, signing
@meshql/uploadmeshql-upload
Multipart uploads with contentHash verification
@meshql/integritymeshql-integrity
Request signing and integrity tokens
@meshql/accessmeshql-access
Entity, row, and field access control
@meshql/pubsubmeshql-pubsub
Pub/sub for real-time subscriptions
@meshql/ssemeshql-sse
Field-aware SSE — Express, Fastify, Hono
@meshql/codemodsmeshql-codemods
GraphQL SDL → MeshQL schema migration
@meshql/gatewaymeshql-gateway
Static multi-service gateway V1
What MeshQL is, who it’s for, and how it fits next to GraphQL and REST.
One /mesh tree — REST writes, selection only on reads.
Mental model — selection, entities, flat rows, nested JSON.
Translation guide, SDL migration, SSE vs subscriptions.
GraphQL comparison, security, ORMs, migration — common questions.
Init a project, start Express, test with curl.
Prisma, Drizzle, and Kysely catch-all resolvers (v0.7.x).
Language-agnostic wire + JoinPlan + shaper for porters.
You own the pool — how MeshQL shares your client.
Schema, JoinPlan, shaper, and plugins.
Routes, headers, errors, and curl recipes.
Client shapes the response
JSON or QL queries via headers. The SDK handles encoding — browsers and Node.
One resolver per entity
JoinPlan tells you exactly which fields and joins to fetch. No N+1 resolver maze.
SQL-native
Optional buildSelectSql() for Postgres and SQLite, or ORM adapters for Prisma, Drizzle, and Kysely (v0.6.0).
Your DB connection
MeshQL does not pool connections — pass your Prisma client, pg.Pool, or Drizzle db into the resolver. See the connections guide.
Framework adapters
Express, Fastify, and Hono — plus Deno and Bun guides with the same HTTP contract.
Security plugins
Integrity signing and access control ship as optional @meshql/integrity and @meshql/access plugins.
One /mesh tree
REST resources for reads and writes. Field selection on reads only — no GraphQL mutation DSL. Reads and writes.
Real-time (v0.9)
@meshql/pubsub + @meshql/sse — field-aware SSE refresh after your mutations. SSE guide.
GraphQL migration
@meshql/codemods converts SDL to MeshQL schema. From GraphQL.
Works everywhere
Node 22+, Bun, Deno, and modern browsers. JSR for source; npm for compiled ESM.