simple-graphql
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -118,3 +118,3 @@ 'use strict'; | ||
return model.count({ | ||
$where: condition | ||
where: condition | ||
}); | ||
@@ -121,0 +121,0 @@ |
{ | ||
"name": "simple-graphql", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "The simple way to generates GraphQL schemas and Sequelize models from your models definition.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -53,3 +53,2 @@ 'use strict'; | ||
var fieldName = _.get(hasManyCfg, 'options.as', name + 's'); | ||
var condition = _.get(hasManyCfg, 'options.scope', {}); | ||
config[fieldName] = { | ||
@@ -60,2 +59,3 @@ $type: _Connection2.default.connectionType(new _ModelRef2.default(hasManyCfg.target)), | ||
var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee(root, args, context, info, models) { | ||
var condition; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -65,6 +65,8 @@ while (1) { | ||
case 0: | ||
condition = _.get(hasManyCfg, 'options.scope', {}); | ||
condition[_.get(hasManyCfg, 'options.foreignKey', name + 'Id')] = root.id; | ||
return _context.abrupt('return', _Connection2.default.resolve(models[hasManyCfg.target], _extends({}, args, { condition: condition }))); | ||
case 2: | ||
case 3: | ||
case 'end': | ||
@@ -71,0 +73,0 @@ return _context.stop(); |
{ | ||
"name": "simple-graphql", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "The simple way to generates GraphQL schemas and Sequelize models from your models definition.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -5,10 +5,15 @@ # Simple-GraphQL | ||
`Simple-GraphQL` generates [GraphQL](https://github.com/graphql/graphql-js) schemas and [Sequelize](http://docs.sequelizejs.com/en/latest/) models from your models definition(support [FlowType](https://flow.org/) static type check), that's how simple it is. The generated GraphQL schema is compatible with [Relay](https://facebook.github.io/relay/). | ||
`Simple-GraphQL` generates [GraphQL](https://github.com/graphql/graphql-js) schemas and [Sequelize](http://docs.sequelizejs.com/en/v3/) models from your models definition(support [FlowType](https://flow.org/) static type check), that's how simple it is. The generated GraphQL schema is compatible with [Relay](https://facebook.github.io/relay/). | ||
>[GraphQL](https://github.com/graphql/graphql-js) is a query language for your API, and a server-side runtime for executing queries by using a type system you define for your data. | ||
>[Sequelize](http://docs.sequelizejs.com/en/latest/) is a promise-based ORM for Node.js. It supports the dialects `PostgreSQL`, `MySQL`, `SQLite` and `MSSQL` and features solid transaction support, relations, read replication and more. | ||
>[Sequelize](http://docs.sequelizejs.com/en/v3/) is a promise-based ORM for Node.js. It supports the dialects `PostgreSQL`, `MySQL`, `SQLite` and `MSSQL` and features solid transaction support, relations, read replication and more. | ||
>[FlowType](https://flow.org/) is a static type checker for your JavaScript code. It does a lot of work to make you more productive. Making you code faster, smarter, more confidently, and to a bigger scale. | ||
## Document | ||
- [API](docs/API.md) | ||
- [Transaction](docs/Transaction.md) | ||
## Install | ||
@@ -175,3 +180,3 @@ | ||
updateMutation?:boolean\|Object | if false, the update GraphQL mutation will not be genereated. | ||
table?:[ModelTableOptionConfig](modeltableoptionconfig) | Reference to [Options](http://docs.sequelizejs.com/en/latest/api/sequelize/#definemodelname-attributes-options-model) of model define [sequelize.define] | ||
table?:[ModelTableOptionConfig](modeltableoptionconfig) | Reference to [Options](http://docs.sequelizejs.com/en/v3/api/sequelize/#definemodelname-attributes-options-model) of model define [sequelize.define] | ||
@@ -247,10 +252,4 @@ ### ModelTableOptionConfig | ||
## Document | ||
- [API](docs/API.md) | ||
## License | ||
[MIT](https://github.com/logerzhu/simple-graphql/blob/master/LICENSE) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
484528
95
4614
253