A utility library for building GraphQL SDL (Schema Definition Language) from PostgreSQL databases using PostGraphile v5. It provides a `SchemaBuilder` class that simplifies constructing GraphQL schemas programmatically by introspecting database schemas and generating types and relationships. Key differentiators: integrates directly with PostGraphile v5's plugin system, eliminates manual schema stitching, and supports dynamic schema generation. Current stable version (1.22.1) is actively maintained with weekly releases. Ships TypeScript types and is part of the Constructive ecosystem.
npm install graphile-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a SchemaBuilder instance, uses PostGraphile v5 to generate a schema from a PostgreSQL database, then outputs the SDL string.
Replace require() with import statements.
Update calls to use the new configuration object format.
Instantiate a new SchemaBuilder per request or use a pool.
Upgrade Node.js or use an older version of the package (pre-1.0).
Change require('graphile-schema') to import { SchemaBuilder } from 'graphile-schema'.Ensure you pass builder.plugin to the PostGraphile schema creation options.
Add "type": "module" to package.json or use dynamic import().
Ensure you call createPostGraphileSchema and pass builder.plugin before calling toSDL().