The Crystal monorepo from Graphile includes Grafast, PostGraphile, and supporting libraries. Grafast executes GraphQL plans efficiently; PostGraphile generates a GraphQL API from PostgreSQL schemas.
Overview
Crystal is Graphile’s monorepo of packages for building GraphQL APIs on Node.js, centered on Grafast and PostGraphile. Grafast is a planning and execution engine that can replace the default GraphQL.js execute path, using plan resolvers to run business logic with less redundant work per request.
PostGraphile focuses on generating a structured, high-performance GraphQL API with PostgreSQL as the primary data source, with emphasis on performance, conventions, and extension through plugins. Related packages include graphile-build for schema plugins, PostgreSQL dataplan helpers, SQL builders such as pg-sql2, pg-introspection for typed catalog access, graphile-config for shared configuration, and graphile-export to materialize dynamic schemas as importable JavaScript.
Use cases split between teams hand-authoring schemas that want Grafast’s execution model and teams that want an auto-generated API from an existing Postgres database they can still customize. PostGraphile stays aligned with upstream PostgreSQL rather than maintaining a separate database fork.
Key features
- Grafast GraphQL plan execution
- PostGraphile schema from Postgres
- Plugin-based GraphQL schema building
- Typed PostgreSQL introspection
- SQL-safe dynamic query builder
- Export in-memory schemas to JS
- PostgreSQL dataplan integrations
- Shared Graphile configuration layer
Use cases
- Auto GraphQL API over PostgreSQL
- High-efficiency custom GraphQL servers
- Modular schema plugins and connections
- Exportable production GraphQL schemas
- Node.js apps with SQL-backed GraphQL