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

@btravstack/pothos

v0.54.0

Published

Pothos fields that call oRPC procedures, each declared error answered as a typed GraphQL refusal

Downloads

5,096

Readme

@btravstack/pothos

Pothos fields that call oRPC procedures, for a GraphQL gateway in front of contract-first services. The default export is the plugin, listed after @unthrown/pothos's: plugins: [RelayPlugin, ErrorsPlugin, UnthrownPlugin, OrpcPlugin].

  • t.procedureField(procedure, { type, call, input, output, refusals? }) validates the field's input through the procedure's own contract before calling it, decodes the answer with output, and answers each error the procedure declares as the GraphQL error class registered for its code — a member of the field's result union. Field-local refusals override the builder's shared orpc: { refusals } defaults. Together the maps must cover every error call can return and InvalidInput; a missing code does not compile. A declared error handled by a narrower call needs no entry.
  • t.procedureConnection(procedure, { …, connection }) is the same for a Relay connection, with the decoded page folded by connection.
  • UNAUTHORIZED and FORBIDDEN are answered as GraphQL's own error, with extensions.code, whether the procedure declares them or not.
  • loadProcedure and procedureErrors are the same answer through a DataLoader; contractCall, contractInput and contractOutput are the contract half on its own.

Every dependency is a peer: Pothos plugins and graphql each need one copy. Install @btravstack/contract alongside them; contractInput reuses its /orpc input-schema accessor.

pnpm add @btravstack/pothos @btravstack/contract @pothos/core @pothos/plugin-errors @pothos/plugin-relay \
  @unthrown/pothos@^0.1.2 graphql unthrown zod \
  @orpc/[email protected] @orpc/[email protected]

See Resolve GraphQL fields from oRPC procedures.