npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@drzl/generator-pothos

v0.2.1

Published

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.

Readme

@drzl/generator-pothos

Generate a Pothos schema builder from a Drizzle schema: one object type per table, each checked against the row type it came from.

Why this and not the SDL

DRZL already emits GraphQL SDL. SDL is a string: it describes a schema and cannot be extended, so a resolver written against it is checked by nothing. A Pothos builder is code, and t.exposeString('emial') is a compile error here where it silently returns undefined there. That is the whole reason to emit one.

Both generators agree exactly on which GraphQL type each column gets. The same column described two ways by two DRZL generators is worse than either description on its own.

Install

npm install -D @drzl/generator-pothos
npm install @pothos/core graphql
// drzl.config.ts
export default {
  schema: './src/db/schema.ts',
  generators: [{ kind: 'pothos', path: 'src/graphql' }],
};

Nullability is stated on every field

Pothos defaults every field to nullable, so a NOT NULL column written as a bare t.exposeString('email') reaches clients as String. The obvious fix, defaultFieldNullability: false on the builder, does not compile: that option is legal only on a builder with no type parameter, which runs in v3 compatibility. On a v4 generic, which is what a generated builder is, it types as never because there it exists only to opt into nullable. The runtime default is nullable in both shapes, so the central switch is unavailable exactly where it would help.

Every emitted field therefore says which it is, which also lets a reader see a column's nullability without knowing anything about the builder.

Scalars

Int only where declared bounds prove 32 bits, Float otherwise, since graphql-js refuses 2^31 and an unbounded integer column must not fail reads. DateTime, BigInt and JSON are registered scalars written into the emitted tree rather than pulled from a dependency. BigInt travels as a string, because JSON.stringify(1n) throws and a number loses precision past 2^53.

Stub resolvers throw rather than returning an empty array: a caller reading [] cannot tell "no rows" from "nobody wrote this yet".

Full documentation: https://use-drzl.github.io/drzl/generators/pothos

Licence

Apache-2.0. Generated output is yours under your own project's licence.