0.0.0-alpha.1 • Published 12 months ago

nx-graphql-codegen v0.0.0-alpha.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

Contents

Features

Installing

Using pnpm:

pnpm add -D nx-graphql-codegen
npm install -D nx-graphql-codegen
yarn add -D nx-graphql-codegen

Peer Dependencies

NameVersionRequired
nx>=15.7.1
@graphql-codgen/cli>=2.16.1

Executors

codegen

Run graphql-codegen.

"targets": {
  "codegen": {
    "executor": "nx-graphql-codegen:codegen",
    "options": {
      "config": "libs/my-lib/codegen.ts",
    },
  },
}
NameTypeRequiredDefaultDescription
configstring-Path to GraphQL codegen YAML config file, defaults to codegen.yml on the current directory.
debugboolean-falseDisplay debugging info by applying the DEBUG env variable.
overwriteboolean-trueOverwrites existing files.
profileboolean-falseUse profiler to measure performance.
projectstring- | Name of a project in GraphQL Config.
requirestring[]-[]Loads specific require.extensions before running the codegen and reading the configuration.
silentboolean-falseSuppresses printing errors.
watchboolean-falseWatch for changes and execute generation automatically.

Generators

codegen

Generate a target to run a graphql-codegen.

nx generate nx-graphql-codegen:codegen dev --project=my-app --config='packages/my-lib/codegen.ts'
>  NX  Generating nx-graphql-codegen:codegen

UPDATE libs/my-lib/project.json
NameAliasTypeRequiredDefaultDescription
config-string-Path to GraphQL codegen YAML config file, defaults to codegen.yml on the current directory.
name-string-Target name.
project-string-What project does the target belong to?

Examples

NamePath
typescript-operationsexamples/typescript-operations

Compatibility

nx-graphql-codegenNx
^0.0.0^15.7.1

Credits

This plugin wouldn't be possible without the great teams behind these projects:

Please show them your support! ❤️