Skip to content

wellth-app/graphql-cli-codegen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graphql-cli-codegen

apollo-codegen plugin for graphql-cli

Warning! This plugin is highly experimental. It is not tested at all and hacks with the codegen internals. Don't expect immediate support.

Installation

npm i -g graphql-cli graphql-cli-codegen

Usage

Configure the plugin via a .graphqlconfig.

The schema will be obtained from the schemaPath key and the files from the includes key.

All other options such as target or output must be placed in the extensions.codegen key.

Here is an example:

.graphqlconfig

{
  "schemaPath": "schema.graphqls",
  "includes": [
    "src/**/*.graphql",
    "src/**/*.gql",
  ],
  "extensions": {
    "codegen": {
      "target": "flow",
      "output": "src/graphql-annotations.js"
    }
  }
}

You can now run:

graphql codegen

It's done now!

About

apollo-codegen plugin for graphql-cli

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 78.5%
  • JavaScript 21.5%