{"_id":"@drzl/generator-pothos","_rev":"2-0f1088041d5bdc66f6f10d81126debc9","name":"@drzl/generator-pothos","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.0":{"name":"@drzl/generator-pothos","version":"0.2.0","keywords":["drizzle","drizzle-orm","pothos","schema-builder","resolvers","codegen"],"license":"Apache-2.0","_id":"@drzl/generator-pothos@0.2.0","maintainers":[{"name":"omar-dulaimi","email":"o.m.dulaimi@gmail.com"}],"dist":{"shasum":"c67fff3baa71da1a4a1d1ec3e785ec4112834348","tarball":"https://registry.npmjs.org/@drzl/generator-pothos/-/generator-pothos-0.2.0.tgz","fileCount":7,"integrity":"sha512-7fx+3hIs1TxIFnjOk297AhJINnOFk8ofYl86yxnzu/wpbd0m4u8TM75coIWiZjy5dUVJnfWLOWX7VCyK86MyvQ==","signatures":[{"sig":"MEYCIQCDjBvAeDwgprz56GdKvNEPQxsTFzNEW9+VuHpghjZCDgIhAP7FcGJSTOF+V7PaxbFcT7BKMIyA/tVSi8CV+dOPBj8a","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47781},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.17.0"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"funding":{"url":"https://github.com/sponsors/omar-dulaimi","type":"github"},"private":false,"scripts":{"lint":"eslint . --ext .ts","test":"vitest run --testTimeout=20000","build":"tsup src/index.ts --dts --format esm,cjs --external prettier --clean"},"_npmUser":{"name":"omar-dulaimi","email":"o.m.dulaimi@gmail.com"},"repository":{"url":"https://github.com/use-drzl/drzl","type":"git","directory":"packages/generator-pothos"},"description":"Generate a Pothos schema builder from a Drizzle schema, one object type per table, with each row type checked against the columns it came from.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"@drzl/analyzer":"^1.22.0","@drzl/validation-core":"^3.23.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","graphql":"^17.0.2","typescript":"^5.9.3","@pothos/core":"^4.13.1"},"_npmOperationalInternal":{"tmp":"tmp/generator-pothos_0.2.0_1786688889096_0.33648541121131403","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@drzl/generator-pothos","version":"0.2.1","private":false,"license":"Apache-2.0","description":"Generate a Pothos schema builder from a Drizzle schema, one object type per table, with each row type checked against the columns it came from.","keywords":["drizzle","drizzle-orm","pothos","schema-builder","resolvers","codegen"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"sideEffects":false,"dependencies":{"@drzl/analyzer":"^1.22.0","@drzl/validation-core":"^3.23.0"},"devDependencies":{"@pothos/core":"^4.13.1","graphql":"^17.0.2","tsup":"^8.5.1","typescript":"^5.9.3"},"engines":{"node":">=18.17.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"repository":{"type":"git","url":"https://github.com/use-drzl/drzl","directory":"packages/generator-pothos"},"funding":{"type":"github","url":"https://github.com/sponsors/omar-dulaimi"},"scripts":{"build":"tsup src/index.ts --dts --format esm,cjs --external prettier --clean","lint":"eslint . --ext .ts","test":"vitest run --testTimeout=20000"},"_nodeVersion":"24.18.0","_id":"@drzl/generator-pothos@0.2.1","dist":{"integrity":"sha512-pc+Fh0Er2v5r8FONv/BTOjkYsxr/45DlgViADKplyo3wPW0hIiU0Qo3Xoakx541dGfZ3OGSq9bBIy20wvej2XQ==","shasum":"a1c25b73213a55b213ea4ff3cb2f9c704245594f","tarball":"https://registry.npmjs.org/@drzl/generator-pothos/-/generator-pothos-0.2.1.tgz","fileCount":7,"unpackedSize":47934,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@drzl%2fgenerator-pothos@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH5gkuLyI2eIWwMlfc2MP2e8toY1QU2M8T2hrq1RQR4KAiA0NFvY292/vtoKmPEpKzuTRGJnALC/bZjHsejIaihqEA=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:7bb6002a-e69e-4cf9-8a5b-a2734a3de116"}},"directories":{},"maintainers":[{"name":"omar-dulaimi","email":"o.m.dulaimi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/generator-pothos_0.2.1_1786697004469_0.39302922108786076"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-14T06:28:08.906Z","modified":"2026-08-14T08:43:24.963Z","0.2.0":"2026-08-14T06:28:09.247Z","0.2.1":"2026-08-14T08:43:24.615Z"},"license":"Apache-2.0","keywords":["drizzle","drizzle-orm","pothos","schema-builder","resolvers","codegen"],"repository":{"type":"git","url":"https://github.com/use-drzl/drzl","directory":"packages/generator-pothos"},"description":"Generate a Pothos schema builder from a Drizzle schema, one object type per table, with each row type checked against the columns it came from.","maintainers":[{"name":"omar-dulaimi","email":"o.m.dulaimi@gmail.com"}],"readme":"# @drzl/generator-pothos\n\nGenerate a [Pothos](https://pothos-graphql.dev) schema builder from a Drizzle schema: one object type\nper table, each checked against the row type it came from.\n\n## Why this and not the SDL\n\nDRZL already emits GraphQL SDL. SDL is a string: it describes a schema and cannot be extended, so a\nresolver written against it is checked by nothing. A Pothos builder is code, and\n`t.exposeString('emial')` is a compile error here where it silently returns `undefined` there. That\nis the whole reason to emit one.\n\nBoth generators agree exactly on which GraphQL type each column gets. The same column described two\nways by two DRZL generators is worse than either description on its own.\n\n## Install\n\n```bash\nnpm install -D @drzl/generator-pothos\nnpm install @pothos/core graphql\n```\n\n```ts\n// drzl.config.ts\nexport default {\n  schema: './src/db/schema.ts',\n  generators: [{ kind: 'pothos', path: 'src/graphql' }],\n};\n```\n\n## Nullability is stated on every field\n\nPothos defaults every field to nullable, so a `NOT NULL` column written as a bare\n`t.exposeString('email')` reaches clients as `String`. The obvious fix,\n`defaultFieldNullability: false` on the builder, does not compile: that option is legal only on a\nbuilder with no type parameter, which runs in v3 compatibility. On a v4 generic, which is what a\ngenerated builder is, it types as `never` because there it exists only to opt *into* nullable. The\nruntime default is nullable in both shapes, so the central switch is unavailable exactly where it\nwould help.\n\nEvery emitted field therefore says which it is, which also lets a reader see a column's nullability\nwithout knowing anything about the builder.\n\n## Scalars\n\n`Int` only where declared bounds prove 32 bits, `Float` otherwise, since graphql-js refuses 2^31 and\nan unbounded integer column must not fail reads. `DateTime`, `BigInt` and `JSON` are registered\nscalars written into the emitted tree rather than pulled from a dependency. `BigInt` travels as a\nstring, because `JSON.stringify(1n)` throws and a number loses precision past 2^53.\n\nStub resolvers throw rather than returning an empty array: a caller reading `[]` cannot tell \"no\nrows\" from \"nobody wrote this yet\".\n\nFull documentation: https://use-drzl.github.io/drzl/generators/pothos\n\n## Licence\n\nApache-2.0. Generated output is yours under your own project's licence.\n","readmeFilename":""}