Socket
Socket
Sign inDemoInstall

@lite-v3/graphql-codegen

Package Overview
Dependencies
33
Maintainers
7
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @lite-v3/graphql-codegen

GraphQL Code Generator for automating type definitions generation


Version published
Weekly downloads
3
increased by200%
Maintainers
7
Created
Weekly downloads
 

Readme

Source

@lite-v3/graphql-codegen

GraphQL Code Generator for automating type definitions generation

By Tokopedia Version

Installation

Install deps

# 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

FAQs

Last updated on 17 May 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc