Umbral GraphQL
Official Featured by Umbral contributorsschema from your models, relations, mutations, subscriptions
About
A REST endpoint returns the shape you designed. A GraphQL endpoint returns the shape the caller designed — which is the whole appeal, and the reason this plugin makes you say yes on purpose. Point it at the models you already declared and it derives the schema: queries, relation traversal, mutations, and live subscriptions, with no resolver code to write and nothing to keep in sync by hand.
Install
Wire it up
use *;
use GraphqlPlugin;
let app = builder
.database
.plugin
.build?;
{ post(id: "1") { title author { username } comments { body } } }
Target: nothing leaves the database by accident
Exposing a model exposes every column on it, so reads and writes are separate opt-ins: expose makes a model readable, mutable makes it writable, subscribable makes it live. A read you got wrong leaks data; a write you got wrong destroys it.
A #[umbral(private)] column stays invisible until allow_private_if unlocks it for a caller who has earned it — and the schema stays one honest document, with the field always present and always nullable, because a caller without the unlock has to legally receive nothing.
What you get
- Schema derived from the model registry — queries, filters, and relations
- Mutations and live subscriptions, each a separate opt-in
- Relation fields batched through a per-request DataLoader, so no N+1
#[umbral(private)]columns unlockable per caller, with one honest schema- Unauthorized writes refused by name, not silently dropped
- GraphiQL explorer in dev
Usage
Nothing is exposed until you call `.expose("table")`, and an exposed model is readable but not writable until you also call `.mutable("table")`. Exposing a model exposes every column on it — reach for `.hide(..)` or `#[umbral(private)]` for anything that shouldn't leave the database.
cargo add umbral-graphql
Feature tracker
Per-feature shipping status, recorded in the directory.
Queries, filters, and types derived from models you already declared.
Walk FK, O2O, and M2M edges in one query, as deep as the caller asks.
Relation fields batch per request, so nested selections don't N+1.
create / update / delete per model — a second opt-in on top of expose.
Live per-model change streams over WebSocket, opt-in per model.
allow_private_if reveals a private column per caller, one honest schema.
hide drops columns from the schema — exposing a model exposes every column.
In-browser query console, toggleable for production.
Compatibility
Declared support per Umbral version and database backend.
No compatibility rows declared yet.
Community notes
0 notes in the discussion thread.
No notes yet. Be the first to share how this plugin works for you.
Reported issues
Bugs and abuse reports filed against this plugin.
No open issues
No issues have been reported against this plugin. Track upstream bugs on the maintainer's tracker, or report a directory problem to the Umbral team.