Skip to content

argano/graphql-codegen-documents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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