Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rricard/graphql-cli-codegen
apollo-codegen plugin for graphql-cli
https://github.com/rricard/graphql-cli-codegen
apollo cli codegen graphql
Last synced: about 14 hours ago
JSON representation
apollo-codegen plugin for graphql-cli
- Host: GitHub
- URL: https://github.com/rricard/graphql-cli-codegen
- Owner: rricard
- License: mit
- Created: 2017-08-02T19:31:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-06T19:29:46.000Z (almost 7 years ago)
- Last Synced: 2024-10-29T01:37:33.916Z (18 days ago)
- Topics: apollo, cli, codegen, graphql
- Language: TypeScript
- Size: 135 KB
- Stars: 22
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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`
```json
{
"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!