# @lite-v3/graphql-codegen

> GraphQL Code Generator for automating type definitions generation

Latest version **0.7.1** (published 2023-05-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install @lite-v3/graphql-codegen
pnpm add @lite-v3/graphql-codegen
yarn add @lite-v3/graphql-codegen
bun add @lite-v3/graphql-codegen
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.1 |
| Published | 2023-05-17 |
| First published | 2022-01-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.17 <17 |
| Dependencies | 12 |
| Unpacked size | 224.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Tokopedia Web Platform Engineer |
| Maintainers | antonybudianto, miqdadfwz, irfan-maulana-tkp, maafaishal-tkpd, 1nd, irfan.maulana, skipper.team |

## Links

- npm: https://www.npmjs.com/package/@lite-v3/graphql-codegen
- Repository: https://github.com/tokopedia/wpe-lite-packages
- Homepage: https://github.com/tokopedia/wpe-lite-packages#readme
- Issues: https://github.com/tokopedia/wpe-lite-packages/issues
- npm.io page: https://npm.io/package/@lite-v3/graphql-codegen

## Dependencies (12)

- [fs](https://npm.io/package/fs.md) ^0.0.1-security
- [path](https://npm.io/package/path.md) ^0.12.7
- [dayjs](https://npm.io/package/dayjs.md) ^1.11.7
- [graphql](https://npm.io/package/graphql.md) ^14.3.1
- [readline](https://npm.io/package/readline.md) ^1.3.0
- [walk-sync](https://npm.io/package/walk-sync.md) 3.0.0
- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [node-fetch](https://npm.io/package/node-fetch.md) 2.6.7
- [picocolors](https://npm.io/package/picocolors.md) ^1.0.0
- [app-root-dir](https://npm.io/package/app-root-dir.md) ^1.0.2
- [tsconfig-paths](https://npm.io/package/tsconfig-paths.md) 3.11.0
- [regenerator-runtime](https://npm.io/package/regenerator-runtime.md) ^0.13.9

## Recent versions

- 0.7.1 (latest) — 2023-05-17
- 0.8.0-beta.0 (beta) — 2025-10-14
- 0.7.1-beta-1 — 2023-05-14
- 0.7.0 — 2023-05-02
- 0.6.0 — 2022-10-29
- 0.6.0-beta.2 — 2022-10-13
- 0.6.0-beta.1 — 2022-10-13
- 0.5.2 — 2022-10-03
- 0.5.2-beta.1 — 2022-09-29
- 0.5.1 — 2022-09-21
- 0.4.1-beta-3 — 2022-09-19
- 0.5.0 — 2022-09-15
- 0.4.1-beta-2 — 2022-09-14
- 0.4.1-beta-1 — 2022-09-14
- 0.5.0-beta-1 — 2022-09-08
- … 7 more at https://npm.io/package/@lite-v3/graphql-codegen/versions

## README

# @lite-v3/graphql-codegen

GraphQL Code Generator for automating type definitions generation

![By Tokopedia](https://img.shields.io/badge/WPE-Tokopedia-brightgreen.svg?style=flat-square) [![Version][npm-badge]][npm]

## Installation

Install deps

```bash
# Use pnpm
pnpm add @lite-v3/graphql-codegen

# Use npm
npm i @lite-v3/graphql-codegen

# Use yarn
yarn add @lite-v3/graphql-codegen
```

## Usage

This package only contains the necessary code (routines and supporting functions) to generate your own type definitions from your schema server to your target GraphQL file(s). You will still need to implement some sort of wrapper program to actually use it, for example creating a CLI to handle joining the logic provided in the routines folder.

Some of the highlight of the provided routines:
- `/routines/manage-schema ... manageSchema()` - Contains the step beginning with downloading the required schema, to partitioning it into a smaller chunks, to storing it in the memory (of our provided Introspection singleton). This function accepts a schema URL as its input.
- `/routines/find-files/gql ... findGqlFiles()` - Contains the step to find for any GraphQL file(s) in a given path. Accepts the target path to be scanned as its input.
- `/routines/gen-supporting-types/baseTypes ... generateBaseTypes()` - Contains the step to help generating the required base / scalar types from a given schema (which came from our Introspection singleton). This function does not need any input and will outputs a Typescript-compliant code as a raw string ready to be saved.
- `/routines/parse-gql-file ... parseOneGqlFile()` - Contains the step to generate the actual type definitions for a given GraphQL file. This function accepts the necessary information of the target GraphQL file and will save the generated code after it has ran successfully.

---

Code By WPE Team @Tokopedia

[npm]: https://www.npmjs.org/package/@lite-v3/graphql-codegen
[npm-badge]: https://img.shields.io/npm/v/@lite-v3/graphql-codegen.svg?style=flat-square

---
_Source: https://npm.io/package/@lite-v3/graphql-codegen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
