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

@eleven-am/golem

v0.7.0

Published

Golem: feed it a Prisma schema, get a full authorized GraphQL API in one NestJS module

Readme

@eleven-am/golem

The NestJS module for Golem. Feed it a Prisma schema and get a complete GraphQL API: queries, mutations with nested writes, live subscriptions, typed hooks, custom operations, and a CASL authorization kernel enforcing row, field, and relation policy on GraphQL and forContext(ctx) calls. Plain generated-client calls are explicit system-level Prisma access and do not run caller policy or Golem hooks.

npm i @eleven-am/golem @eleven-am/golem-core
npm i -D @eleven-am/golem-generator

See the full guide for the quickstart, configuration reference, and authorization model.

If you set GraphQLModule's context, it must be a function — context: ({ req }) => ({ req }) — never a static object. @nestjs/apollo reuses a static object across requests with the first caller's req still attached, so every later caller is served as the first one. Golem stamps each request through a middleware it registers itself and fails any operation whose context belongs to another request; a context deliberately shared across requests must carry [golemSharedContext]: true (the symbol is exported from @eleven-am/golem).

Since 0.4, computed fields are real Nest field resolvers. Import the typed ComputedField helper from the generated Golem module, use @Parent()/@Context()/@Args(), and pass golem.fieldResolverEnhancers to GraphQLModule. This enables ordinary Nest pipes, guards, interceptors, filters, and request-scoped providers. A computed field that queries for other rows can be declared with BatchedComputedField instead, which loads every parent key resolved in the same tick in one query, per request and through the caller's context. See the root migration guide for the positional-parent breaking change.

Production event bounds are configured at the module boundary:

GolemModule.forRoot({
  // client, datamodel, authorization, models ...
  subscription: { queueCapacity: 64, observer },
  batchEvents: { maxRows: 1_000, maxPayloadBytes: 1_048_576 },
});

One local hub owns each model's event-bus iterator and disconnects a full consumer with GOLEM_SUBSCRIPTION_OVERFLOW. Top-level batch events remain buffered until commit. batchEvents.maxRows also bounds every delete, counting the dependents its onDelete actions cascade to; each cascaded row emits its own event. Delivery is not durable or exactly-once. Startup validates the reserved _golem_upsert_guard table/delegate whether or not authorization is enabled and, on PostgreSQL, creates every guard stripe row; apply the provider artifact from @eleven-am/golem-core before deploying. Only the postgresql and sqlite datasource providers are accepted; any other is refused at startup.