// the find
graphile/crystal
🔮 Graphile's Crystal Monorepo; home to Grafast, PostGraphile, pg-introspection, pg-sql2 and much more!
PostGraphile v5 and its underlying Grafast execution engine — auto-generates a GraphQL API from a PostgreSQL schema, with Grafast acting as a smarter executor that plans the entire request as a dependency graph before executing it. Aimed at teams where PostgreSQL is genuinely the application logic layer, not just storage. Also ships standalone packages (pg-sql2, pg-introspection) that are useful independently.
Grafast's planning model genuinely eliminates the N+1 problem at the executor level rather than patching it with DataLoader hacks — the SQL snapshots in the test suite show single batched queries where traditional resolvers would issue dozens. pg-sql2's tagged template approach to safe dynamic SQL is the right idea and well-executed. pg-introspection being generated directly from PostgreSQL docs means it tracks the actual catalog accurately. The graphile-export concept — turning a dynamically built schema into static JS — is a practical escape hatch if you ever need to stop relying on PostGraphile.
The learning curve for Grafast plan resolvers is steep; you're not writing resolvers anymore, you're writing a dataflow graph, and the mental model shift is significant enough that onboarding new developers takes real time. The monorepo is enormous and the interdependencies between packages are not always obvious — debugging across grafast/dataplan-pg/graphile-build-pg is a scavenger hunt. PostGraphile still assumes your database schema is relatively well-structured for GraphQL exposure; schemas with heavy use of EAV patterns, polymorphic tables, or non-standard naming conventions require substantial plugin work. Single corporate sponsor, primarily one maintainer (benjie) — bus factor is real and the project has already had one major version discontinuity (v4 to v5).