nx-graphql-codegen
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-alpha.1 • Public • Published


Contents


Features


Installing

Using pnpm:

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

Peer Dependencies

Name Version Required
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",
    },
  },
}
codegen executor options
Name Type Required Default Description
config string - Path to GraphQL codegen YAML config file, defaults to codegen.yml on the current directory.
debug boolean - false Display debugging info by applying the DEBUG env variable.
overwrite boolean - true Overwrites existing files.
profile boolean - false Use profiler to measure performance.
project string - `` Name of a project in GraphQL Config.
require string[] - [] Loads specific require.extensions before running the codegen and reading the configuration.
silent boolean - false Suppresses printing errors.
watch boolean - false Watch 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'
codegen generator output
>  NX  Generating nx-graphql-codegen:codegen

UPDATE libs/my-lib/project.json
codegen generator options
Name Alias Type Required Default Description
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

Name Path
typescript-operations examples/typescript-operations

Compatibility

nx-graphql-codegen Nx
^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! ❤️



🌳 🦌 🌳


Package Sidebar

Install

npm i nx-graphql-codegen

Weekly Downloads

0

Version

0.0.0-alpha.1

License

MIT

Unpacked Size

40.9 kB

Total Files

50

Last publish

Collaborators

  • domjtalbot