graphql-gene (v1.3.7) automatically generates an executable GraphQL schema and resolvers from your ORM models, supporting TypeScript out of the box. It focuses on performance by leveraging a lookahead pattern (via graphql-lookahead) to only fetch the data required by the client, reducing over-fetching. Stable release cadence; requires GraphQL 16.x. Differentiator: ORM introspection + lookahead-driven resolution, removing manual resolver boilerplate while optimizing database queries.
npm install graphql-geneNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to generate a GraphQL schema from ORM models and serve it with graphql-http.
Upgrade to graphql@^16.0.0.
Use ESM imports (import syntax) or dynamic import require('.cjs') if available. This package does not provide a CJS entry.Pass all options as the second argument: generateSchema(models, options) where options includes schemaDirectives, scalars, etc.
Run npm install graphql-lookahead.
Ensure models export an array of model classes/objects with 'name' and 'fields' properties. Refer to documentation for exact shape.
npm install graphql-lookahead
Use import { generateSchema } from 'graphql-gene' instead of require.Verify models export an array of model classes with 'name' and 'fields'.