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

@graphql-recodegen/cli

v0.4.5

Published

Faster GraphQL codegen for TypeScript projects

Readme

Recodegen

Faster GraphQL codegen for TypeScript projects

Installation

Binary

  • you can download binaries from Releases page

NPM

Globally via NPM

  • npm install -g @graphql-recodegen/cli
  • to run recodegen -config=recodegen.json

Locally via NPM

  • npm install --save-dev @graphql-recodegen/cli
  • to run ./node_modules/.bin/recodegen -config=recodegen.json

Build from Source

  • git clone [email protected]:poul-kg/recodegen.git
  • cd recodegen
  • cd cmd/recodegen
  • go build - you'll see a binary file created
  • go install - to install recodegen and be able to run it from any directory. For this to work make sure your PATH contains output from go env GOPATH command

Usage

  • ./recodegen - reads recodegen.json and tries to generate types
  • ./recodegen -config=codegen.json - can specify custom JSON file

Configuration

  • the idea was to re-use existing Apollo @graphql-codegen/cli JSON config format
  • plugins: ['typescript'] - will generate schema types
  • plugins: ['typescript-operations'] - will generate operations
  • only two plugins supported: plugins: ['typescript', 'typescript-operations']
  • you can't use documents: like documents: "dir/*.ts" it should be documents: ["dir/*.ts"]
  • basically two config examples you see below are the only supported options for now, everything else will be ignored or will throw an error

Config 1 - separate files for generated schema and operations

The following config will:

  • read GraphQL schema from schema/backend.graphql file
  • generate generated/schema.generated.ts file with all schema types
  • scan all *.ts files in ./backend directory and try to extract GraphQL queries, which should be defined as
 // backend/my-service.ts
 const query = gql`
   query findUser($id: uuid!) {
     first_name
     last_name
   }
 `;
  • Writes operations into generated/operations.ts
  • operations.ts will import schema types like import * as Types from "./schema.generated";

recodegen.json

{
  "overwrite": true,
  "schema": "schema/backend.graphql",
  "generates": {
    "generated/schema.generated.ts": {
      "plugins": [
        "typescript"
      ]
    },
    "generated/operations.ts": {
      "preset": "import-types",
      "presetConfig": {
        "typesPath": "./schema.generated"
      },
      "plugins": [
        "typescript-operations"
      ],
      "documents": ["backend/**/*.ts"]
    }
  }
}

Config 2 - single file for generated schema and operations

recodegen.json

{
  "overwrite": true,
  "schema": "schema/backend.graphql",
  "generates": {
    "generated/schema.generated.ts": {
      "plugins": [
        "typescript", "typescript-operations"
      ],
      "documents": ["backend/**/*.ts"]
    }
  }
}
  • ./recodegen - to build schema file and operations file

Known Issues

  • [ ] some output is not properly formatted
  • [x] types in the generated output may change order on every new generation
  • [x] generated files are overwritten even if there is no change
  • [ ] No Interface support
  • [ ] No Union support
  • [ ] no unit tests
  • [ ] GraphQL fragment support is limited but something is supported
  • [ ] some type names might differ a bit from what is generated by @graphql-codegen/cli
  • it's pretty raw right now, was done pretty quickly to avoid constant disappointment with slow codegen