@micimize/graphql-code-generator
[Refer to full documentation, examples and more here](https://github.com/dotansimha/graphql-code-generator/blob/master/README.md)
Last updated 2 years ago by micimize .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @micimize/graphql-code-generator 
SYNC missed versions from official npm registry.

graphql-codegen-cli

Refer to full documentation, examples and more here

This package is the front-facing package of the code generator.

It parses the CLI commands into a GeneratorConfig and Settings object, and also in charge of reading and writing files from the filesystem, and execute Introspection request to remote GraphQL endpoints.

For a full CLI documentation, please refer to the main README file of the package.

gql-gen.json

gql-gen.json is a local config file, provides a custom config when using custom templates.

This is an example for a valid file:

{
  "flattenTypes": true,
  "primitives": {
    "String": "string",
    "Int": "number",
    "Float": "number",
    "Boolean": "boolean",
    "ID": "string"
  },
  "customHelpers": {
    "myHelper": "./my-helper.js"
  }
}

You can override the config for flattenTypes and primitives (refer to graphql-codegen-compiler package README for more info).

You can also specify JavaScript files for customHelpers when generating custom templates (the custom files should export a Function as default).

Generator Specific Config

You can also pass configuration object to the output generator, by adding generatorConfig to the gql-gen.json file:

{
  "generatorConfig": {
    "myConfig": "my value"
  },
  "flattenTypes": true,
  "primitives": {
    "String": "string",
    "Int": "number",
    "Float": "number",
    "Boolean": "boolean",
    "ID": "string"
  }
}

Current Tags

  • 0.9.0-alpha.1                                ...           latest (2 years ago)

2 Versions

  • 0.9.0-alpha.1                                ...           2 years ago
  • 0.9.0-alpha                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (10)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2017 © taobao.org |