{"id":40844,"library":"drizzle-graphql","title":"drizzle-graphql","description":"Automatically generate GraphQL schema or customizable schema config fields from Drizzle ORM schema. Current stable version is 0.8.5, with a moderate release cadence. It wraps Drizzle ORM tables into GraphQL types, queries, mutations, and inputs, allowing rapid GraphQL API creation. Differentiators: tight integration with Drizzle ORM, automatic schema generation with TypeScript types, and flexible customization via entities object.","status":"active","version":"0.8.5","language":"javascript","source_language":"en","source_url":"https://github.com/drizzle-team/drizzle-graphql","tags":["javascript","drizzle","graphql","orm","pg","mysql","postgresql","postgres","sqlite","typescript"],"install":[{"cmd":"npm install drizzle-graphql","lang":"bash","label":"npm"},{"cmd":"yarn add drizzle-graphql","lang":"bash","label":"yarn"},{"cmd":"pnpm add drizzle-graphql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for Drizzle ORM schema and database instance","package":"drizzle-orm","optional":false},{"reason":"Peer dependency required for GraphQL types and schema construction","package":"graphql","optional":false}],"imports":[{"note":"Named export, not default export. Only ESM supported.","wrong":"import buildSchema from 'drizzle-graphql'","symbol":"buildSchema","correct":"import { buildSchema } from 'drizzle-graphql'"},{"note":"Package is ESM-only; CommonJS require is not supported.","wrong":"const { buildSchema } = require('drizzle-graphql')","symbol":"buildSchema","correct":"import { buildSchema } from 'drizzle-graphql'"},{"note":"Access generated queries from the entities object returned by buildSchema.","wrong":"","symbol":"entities.queries","correct":"const { entities } = buildSchema(db); entities.queries.users"},{"note":"Entity types are Drizzle table derived GraphQLObjectType instances.","wrong":"","symbol":"entities.types","correct":"const { entities } = buildSchema(db); entities.types.UsersItem"}],"quickstart":{"code":"import { buildSchema } from 'drizzle-graphql';\nimport { pgTable, integer, varchar } from 'drizzle-orm/pg-core';\nimport { drizzle } from 'drizzle-orm/node-postgres';\n\nconst users = pgTable('users', {\n  id: integer('id').primaryKey(),\n  name: varchar('name', { length: 100 }),\n});\n\nconst db = drizzle(process.env.DATABASE_URL ?? '');\n\nconst { schema, entities } = buildSchema(db);\n\n// Use schema directly or customize with entities\n// Example: host with GraphQL Yoga\nimport { createYoga } from 'graphql-yoga';\nimport { createServer } from 'node:http';\n\nconst yoga = createYoga({ schema });\nconst server = createServer(yoga);\nserver.listen(4000, () => console.log('Server running on http://localhost:4000/graphql'));","lang":"typescript","description":"Shows how to define a Drizzle ORM table, create a database instance, build the GraphQL schema with buildSchema, and serve it with GraphQL Yoga."},"warnings":[{"fix":"Update your peer dependencies to compatible versions.","message":"drizzle-graphql requires drizzle-orm >=0.30.9 and graphql >=16.3.0","severity":"breaking","affected_versions":">=0.8.5"},{"fix":"","message":"Package is still in early active development; no deprecated features reported yet.","severity":"deprecated","affected_versions":"all"},{"fix":"Use ES module syntax (import) or configure your project for ESM.","message":"The package is ESM-only; CommonJS require will fail with ERR_REQUIRE_ESM.","severity":"gotcha","affected_versions":">=0.8.5"},{"fix":"Always check that db is properly initialized and schema is valid.","message":"buildSchema returns an object with schema and entities; entities may be undefined if schema generation fails.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.8.5':21 'allow':39 'api':42 'automat':4,50 'cadenc':26 'config':11 'creation':43 'current':17 'custom':58 'customiz':9 'differenti':44 'drizzl':2,14,29,48,63 'drizzle-graphql':1 'entiti':60 'field':12 'flexibl':57 'generat':5,52 'graphql':3,6,33,41,64 'input':38 'integr':46 'javascript':62 'moder':24 'mutat':36 'mysql':67 'object':61 'orm':15,30,49,65 'pg':66 'postgr':69 'postgresql':68 'queri':35 'rapid':40 'releas':25 'schema':7,10,16,51 'sqlite':70 'stabl':18 'tabl':31 'tight':45 'type':34,55 'typescript':54,71 'version':19 'via':59 'wrap':28","created_at":"2026-06-04T18:49:32.539140+00:00","updated_at":"2026-06-04T18:49:32.539140+00:00","problems":[{"fix":"Run 'npm install drizzle-graphql' and ensure you have proper TypeScript configuration.","cause":"Package not installed or types not resolved","error":"Cannot find module 'drizzle-graphql'"},{"fix":"Replace require() with import or set 'type': 'module' in package.json.","cause":"Using require() instead of import","error":"ERR_REQUIRE_ESM"},{"fix":"Verify your Drizzle schema exports the table with the expected name and pass db correctly to buildSchema.","cause":"Table name mismatch or buildSchema not called correctly","error":"Query 'users' not found in generated schema"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://orm.drizzle.team/docs/graphql","github":"https://github.com/drizzle-team/drizzle-graphql","docs":null,"changelog":null,"pypi":null,"npm":"drizzle-graphql","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}