@madsci/graphql-codegen-nestjs
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

graphql-codegen-nestjs

A plugin for GraphQL Code Generator that produces classes suitable for use with @nestjs/graphql in "code first" mode.

This is based on the official TypeGraphQL plugin but it uses decorators from @nestjs/graphql instead of type-graphql.

Usage

Installation:

npm i -D @madsci/graphql-codegen-nestjs

Add the plugin to a Codegen output as @madsci/graphql-codegen-nestjs. Example:

generates:
  './src/schema.ts':
    plugins:
      - '@madsci/graphql-codegen-nestjs'
      - 'typescript-operations'

Configuration

Extends the typescript plugin so it supports all of the config parameters of that plugin, plus:

decoratorName

type: Partial

Allows the decorators for each type to be customised. Example:

config:
  decoratorName:
    type: 'ObjectType'
    interface: 'InterfaceType'
    arguments: 'ArgsType'
    field: 'Field'
    input: 'InputType'

Readme

Keywords

none

Package Sidebar

Install

npm i @madsci/graphql-codegen-nestjs

Weekly Downloads

19

Version

0.0.3

License

MIT

Unpacked Size

29.7 kB

Total Files

11

Last publish

Collaborators

  • sgarner