Graphene-JS
A Sequelize integration for Graphene-JS.
Installation
For installing Graphene Sequelize, just run this command in your shell
npm install --save graphene-sequelize# or yarn add graphene-sequelize
Examples
Here is a simple Sequelize model:
; const UserModel = sequelize;
To create a GraphQL schema for it you simply have to write the following:
;; @ // Fields will be populated automatically from the sequelize // model, and we can also add extra fields here. @ { return UserModel; } schema = query: Query ;
Then you can simply query the schema:
const query = `query { users { name, lastName }}`result = await schema
To learn more check out the following examples:
- Schema with Filtering: Cookbook example
- Relay Schema: Starwars Relay example
Contributing
After developing, the full test suite can be evaluated by running:
yarn test --coverage
Documentation
The documentation is generated using the excellent Sphinx and a custom theme.
The documentation dependencies are installed by running:
cd docspip install -r requirements.txt
Then to produce a HTML version of the documentation:
make html