0.2.0 • Published 8 months ago

graphql-codegen-documents v0.2.0

Weekly downloads
169
License
MIT
Repository
github
Last release
8 months ago

graphql-codegen-documents

GraphQL Code Generator plugin for generating documents.

Installation

  • with NPM npm install --save graphql-codegen-documents
  • with Yarn: yarn add graphql-codegen-documents

Usage

NOTE: This plugin is meant to run independently before other plugins that need to use documents.

For example, in your package.json scripts, add:

{
    "gen": "graphql-codegen -c {your-graphql-codegen-documents-config-file}.yaml && graphql-codegen"
}

and in your your-graphql-codegen-documents-config-file:

schema:
  - path/to/schema.graphql
documents:
  - path/to/my-custom-documents.graphql
generates:
  path/to/generated-docs.graphql:
    plugins:
      - graphql-codegen-documents
    config:
      recursionLimit: 7

and then your other plugins

schema:
  - path/to/schema.graphql
documents:
  - path/to/my-custom-documents.graphql
  - path/to/generated-documents.graphql
generates:
  # Other plugins

TODO