graysql-orm-loader-waterline
v0.1.0
Published
Waterline translator for graysql-orm-loader.
Downloads
5
Maintainers
Readme
Waterline Translator
This is a translator for graysql-orm-loader that will translate the models defined in Waterline to a valid GraphQL schema.
Installation
Install it from npm. Make sure to install its peer-dependencies as well.
$ npm install graysql-orm-waterline
Examples
Here is an example using Sails.js and Waterline.
const GraysQL = require('graysql');
const ORMLoader = require('graysql-orm-loader');
const WaterlineTranslator = require('graysql-orm-loader-waterline');
const GQL = new GraysQL();
GQL.use(ORMLoader);
GQL.loadFromORM(new WaterlineTranslator(sails.models));
const Schema = GQL.generateSchema();
Examples
Usage example can be found in example directory.
Tests
The tests are written with mocha and can be run with the following command:
$ npm test
To get code coverage reports, run the following command:
$ npm run cover