@madsci/graphql-codegen-nestjs
v0.0.3
Published
GraphQL Code Generator plugin for @nestjs/graphql
Downloads
42
Readme
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'