UNPKG

objection-graphql

Version:

Automatically generates GraphQL schema for objection.js models and allows to extend the schema with custom mutations and subscriptions

18 lines (12 loc) 344 B
const _ = require('lodash'); function isExcluded(opt, prop) { return (opt.include && opt.include.indexOf(prop) === -1) || (opt.exclude && opt.exclude.indexOf(prop) !== -1); } function typeNameForModel(modelClass) { return _.upperFirst(_.camelCase(modelClass.tableName)); } module.exports = { isExcluded, typeNameForModel, };