GenerateQL v0.1.0 — protoc, but for GraphQL
#10851
Unanswered
oh-tarnished
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
GenerateQL turns any GraphQL endpoint into a typed, idiomatic client library. Point it at a server that supports standard introspection — Hasura, Hasura DDN / Grafbase, Prisma-backed engines — and it emits a self-contained SDK: typed models, a fluent predicate DSL for filters, single-object create/update inputs, and one method per query, mutation, and subscription, organized into clean per-domain packages on a small transport runtime.
The idea is to make the schema the single source of truth. Hand-written query strings and client code drift from the schema; GenerateQL is a small compiler that closes that gap the way
protocdoes for.proto. It introspects, normalizes the result into a language-agnostic IR, runs analysis passes, and renders code. Mistakes fail at compile time instead of in production.What you get:
svc.Query.Booking.Contacts.List(ctx, …)with native values. No raw input structs, no pointers.Eq/In/Like/…,And/Or/Not, relation filters, ordering. NoBoolExpleaking into your code.List/Get/Find/Aggregate,Create/Update/Delete, plusOn*subscriptions.QueryRaw/ExecuteRawfor anything the typed API doesn't cover.gofmt-clean output;--dump-schemaships the exactschema.jsonit was built from.Today: Go is shipping (
--lang go). Installing the CLI needs Go 1.26+; generated code needs Go 1.24+ (forencoding/jsonomitzero).On the roadmap: the IR is already language-agnostic, so the generator is built to retarget. Python, TypeScript, and Rust client targets are coming in future releases, along with
.protooutput.Get started:
go install github.com/oh-tarnished/generateql/cmd/generateql@latestDrop a
generateql.yamlin your project, thengenerateql generate. A complete runnable example (config, generated library, and amain.goexercising full CRUD + a live subscription) lives inexamples/freebusy.Apache-2.0. Repo, docs, and the v0.1.0 release: https://github.com/oh-tarnished/generateql
This is an early release and I'm the author — feedback, issues, and stars genuinely help me prioritize the language targets. If Python, TypeScript, or Rust is the one you're waiting on, open an issue and say so.
Beta Was this translation helpful? Give feedback.
All reactions