Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flipside/gulp-graphql
Keep your graphql schema up-to-date with gulp!
https://github.com/flipside/gulp-graphql
Last synced: about 2 months ago
JSON representation
Keep your graphql schema up-to-date with gulp!
- Host: GitHub
- URL: https://github.com/flipside/gulp-graphql
- Owner: flipside
- License: mit
- Created: 2015-09-28T21:03:03.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-29T23:56:05.000Z (about 9 years ago)
- Last Synced: 2024-09-29T05:44:22.338Z (3 months ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 11
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-graphql - gulp-graphql
README
# gulp-graphql
> Keep your graphql schema up-to-date with gulp!
> Made for gulp 3## Features
* Attempts to generate a graphql schema from `schema.js`
* Can output both `schema.json` and `schema.graphql`## Installation
```shell
npm install gulp-graphql --save-dev
```
## Usage
Example `gulpfile.babel.js`:
```javascript
import gulp from 'gulp';
import schema from 'gulp-graphql';gulp.task("schema", () => {
console.log("Generating graphql schema...");return gulp.src("src/data/schema.js")
.pipe(schema({
json: true,
graphql: false,
}))
.on('error', console.log)
.pipe(gulp.dest("src/data"))
.pipe(gulp.dest("dist/data"));
});gulp.task('watch-schema', () => {
gulp.watch("src/data/schema.js", [ 'schema' ]);
});gulp.task("default", ["schema"]);
```
## Options
* `json` (optional) (default: `true`)
* Generate a graphql schema from your `schema.js` and output to `schema.json`
* `graphql` (optional) (default: `true`)
* Output schema as a readable `schema.graphql` file
* `fileName` (optional) (default: `schema`)
* Base name for your schema file, no extension
* `indentation` (optional) (default: `2`)
* Takes an `Integer` for indentation spaces of `schema.json`
* `graphqlPath` (optional)
* Override for where to find `graphql` module.## Notes
Passing in `graphql` via init is a hack that I'm not thrilled about but seems to work.## Release log
#### 0.2.0
* No longer needs to be initialized!
* Attempts to find modules `graphql` and `graphql/utitlites` on its own.#### 0.1.0
* Generates graphql `schema.json` and `schema.graphql` files w/ tests.## Licence
MIT License