graphile-build-pg
Advanced tools
Comparing version 0.1.0-alpha.28 to 0.1.0-alpha.29
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.postGraphQLClassicIdsInflection = exports.postGraphQLInflection = exports.defaultInflection = undefined; | ||
exports.defaultInflection = exports.newInflector = exports.defaultUtils = undefined; | ||
@@ -21,161 +21,170 @@ var _assign = require("babel-runtime/core-js/object/assign"); | ||
var defaultInflection = exports.defaultInflection = { | ||
var defaultUtils = exports.defaultUtils = { | ||
constantCase: _utils.constantCase, | ||
camelCase: _utils.camelCase, | ||
upperCamelCase: _utils.upperCamelCase, | ||
pluralize: _pluralize2.default, | ||
argument(name, index) { | ||
return (0, _utils.camelCase)(name || `arg${index}`); | ||
}, | ||
orderByType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${(0, _pluralize2.default)(typeName)}-order-by`)); | ||
}, | ||
orderByEnum(name, ascending, _table, _schema) { | ||
return (0, _utils.constantCase)(`${name}_${ascending ? "asc" : "desc"}`); | ||
}, | ||
domainType(name) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(name)); | ||
}, | ||
enumName(value) { | ||
return value; | ||
}, | ||
enumType(name) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(name)); | ||
}, | ||
conditionType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${typeName}-condition`)); | ||
}, | ||
inputType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${typeName}-input`)); | ||
}, | ||
rangeBoundType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${typeName}-range-bound`)); | ||
}, | ||
rangeType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${typeName}-range`)); | ||
}, | ||
patchType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${typeName}-patch`)); | ||
}, | ||
patchField(itemName) { | ||
return (0, _utils.camelCase)(`${itemName}-patch`); | ||
}, | ||
tableName(name, _schema) { | ||
return (0, _utils.camelCase)(_pluralize2.default.singular(name)); | ||
}, | ||
tableNode(name, _schema) { | ||
return (0, _utils.camelCase)(_pluralize2.default.singular(name)); | ||
}, | ||
allRows(name, schema) { | ||
return (0, _utils.camelCase)(`all-${this.pluralize(this.tableName(name, schema))}`); | ||
}, | ||
functionName(name, _schema) { | ||
return (0, _utils.camelCase)(name); | ||
}, | ||
functionPayloadType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${name}-payload`)); | ||
}, | ||
functionInputType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${name}-input`)); | ||
}, | ||
tableType(name, schema) { | ||
return (0, _utils.upperFirst)(this.tableName(name, schema)); | ||
}, | ||
column(name, _table, _schema) { | ||
return (0, _utils.camelCase)(name); | ||
}, | ||
singleRelationByKeys(detailedKeys, table, schema) { | ||
var _this = this; | ||
singularize: _pluralize2.default.singular | ||
}; | ||
return (0, _utils.camelCase)(`${this.tableName(table, schema)}-by-${detailedKeys.map(function (key) { | ||
return _this.column(key.column, key.table, key.schema); | ||
}).join("-and-")}`); | ||
}, | ||
updateByKeys(detailedKeys, table, schema) { | ||
var _this2 = this; | ||
var newInflector = exports.newInflector = function newInflector() { | ||
var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; | ||
return (0, _utils.camelCase)(`update-${this.tableName(table, schema)}-by-${detailedKeys.map(function (key) { | ||
return _this2.column(key.column, key.table, key.schema); | ||
}).join("-and-")}`); | ||
}, | ||
deleteByKeys(detailedKeys, table, schema) { | ||
var _this3 = this; | ||
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultUtils, | ||
constantCase = _ref.constantCase, | ||
camelCase = _ref.camelCase, | ||
upperCamelCase = _ref.upperCamelCase, | ||
pluralize = _ref.pluralize, | ||
singularize = _ref.singularize; | ||
return (0, _utils.camelCase)(`delete-${this.tableName(table, schema)}-by-${detailedKeys.map(function (key) { | ||
return _this3.column(key.column, key.table, key.schema); | ||
}).join("-and-")}`); | ||
}, | ||
updateNode(name, _schema) { | ||
return (0, _utils.camelCase)(`update-${_pluralize2.default.singular(name)}`); | ||
}, | ||
deleteNode(name, _schema) { | ||
return (0, _utils.camelCase)(`delete-${_pluralize2.default.singular(name)}`); | ||
}, | ||
updateByKeysInputType(detailedKeys, name, _schema) { | ||
var _this4 = this; | ||
return (0, _assign2.default)({ | ||
pluralize, | ||
argument(name, index) { | ||
return camelCase(name || `arg${index}`); | ||
}, | ||
orderByType(typeName) { | ||
return upperCamelCase(`${pluralize(typeName)}-order-by`); | ||
}, | ||
orderByEnum(name, ascending, _table, _schema) { | ||
return constantCase(`${name}_${ascending ? "asc" : "desc"}`); | ||
}, | ||
domainType(name) { | ||
return upperCamelCase(name); | ||
}, | ||
enumName(value) { | ||
return value; | ||
}, | ||
enumType(name) { | ||
return upperCamelCase(name); | ||
}, | ||
conditionType(typeName) { | ||
return upperCamelCase(`${typeName}-condition`); | ||
}, | ||
inputType(typeName) { | ||
return upperCamelCase(`${typeName}-input`); | ||
}, | ||
rangeBoundType(typeName) { | ||
return upperCamelCase(`${typeName}-range-bound`); | ||
}, | ||
rangeType(typeName) { | ||
return upperCamelCase(`${typeName}-range`); | ||
}, | ||
patchType(typeName) { | ||
return upperCamelCase(`${typeName}-patch`); | ||
}, | ||
patchField(itemName) { | ||
return camelCase(`${itemName}-patch`); | ||
}, | ||
tableName(name, _schema) { | ||
return camelCase(singularize(name)); | ||
}, | ||
tableNode(name, _schema) { | ||
return camelCase(singularize(name)); | ||
}, | ||
allRows(name, schema) { | ||
return camelCase(`all-${this.pluralize(this.tableName(name, schema))}`); | ||
}, | ||
functionName(name, _schema) { | ||
return camelCase(name); | ||
}, | ||
functionPayloadType(name, _schema) { | ||
return upperCamelCase(`${name}-payload`); | ||
}, | ||
functionInputType(name, _schema) { | ||
return upperCamelCase(`${name}-input`); | ||
}, | ||
tableType(name, schema) { | ||
return upperCamelCase(this.tableName(name, schema)); | ||
}, | ||
column(name, _table, _schema) { | ||
return camelCase(name); | ||
}, | ||
singleRelationByKeys(detailedKeys, table, schema) { | ||
var _this = this; | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`update-${_pluralize2.default.singular(name)}-by-${detailedKeys.map(function (key) { | ||
return _this4.column(key.column, key.table, key.schema); | ||
}).join("-and-")}-input`)); | ||
}, | ||
deleteByKeysInputType(detailedKeys, name, _schema) { | ||
var _this5 = this; | ||
return camelCase(`${this.tableName(table, schema)}-by-${detailedKeys.map(function (key) { | ||
return _this.column(key.column, key.table, key.schema); | ||
}).join("-and-")}`); | ||
}, | ||
updateByKeys(detailedKeys, table, schema) { | ||
var _this2 = this; | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`delete-${_pluralize2.default.singular(name)}-by-${detailedKeys.map(function (key) { | ||
return _this5.column(key.column, key.table, key.schema); | ||
}).join("-and-")}-input`)); | ||
}, | ||
updateNodeInputType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`update-${_pluralize2.default.singular(name)}-input`)); | ||
}, | ||
deleteNodeInputType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`delete-${_pluralize2.default.singular(name)}-input`)); | ||
}, | ||
manyRelationByKeys(detailedKeys, table, schema) { | ||
var _this6 = this; | ||
return camelCase(`update-${this.tableName(table, schema)}-by-${detailedKeys.map(function (key) { | ||
return _this2.column(key.column, key.table, key.schema); | ||
}).join("-and-")}`); | ||
}, | ||
deleteByKeys(detailedKeys, table, schema) { | ||
var _this3 = this; | ||
return (0, _utils.camelCase)(`${this.pluralize(this.tableName(table, schema))}-by-${detailedKeys.map(function (key) { | ||
return _this6.column(key.column, key.table, key.schema); | ||
}).join("-and-")}`); | ||
}, | ||
edge(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${(0, _pluralize2.default)(typeName)}-edge`)); | ||
}, | ||
edgeField(name, _schema) { | ||
return (0, _utils.camelCase)(`${_pluralize2.default.singular(name)}-edge`); | ||
}, | ||
connection(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${this.pluralize(typeName)}-connection`)); | ||
}, | ||
scalarFunctionConnection(procName, _procSchema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${procName}-connection`)); | ||
}, | ||
scalarFunctionEdge(procName, _procSchema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${procName}-edge`)); | ||
}, | ||
createField(name, _schema) { | ||
return (0, _utils.camelCase)(`create-${_pluralize2.default.singular(name)}`); | ||
}, | ||
createInputType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`create-${_pluralize2.default.singular(name)}-input`)); | ||
}, | ||
createPayloadType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`create-${_pluralize2.default.singular(name)}-payload`)); | ||
}, | ||
updatePayloadType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`update-${_pluralize2.default.singular(name)}-payload`)); | ||
}, | ||
deletePayloadType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`delete-${_pluralize2.default.singular(name)}-payload`)); | ||
} | ||
return camelCase(`delete-${this.tableName(table, schema)}-by-${detailedKeys.map(function (key) { | ||
return _this3.column(key.column, key.table, key.schema); | ||
}).join("-and-")}`); | ||
}, | ||
updateNode(name, _schema) { | ||
return camelCase(`update-${singularize(name)}`); | ||
}, | ||
deleteNode(name, _schema) { | ||
return camelCase(`delete-${singularize(name)}`); | ||
}, | ||
updateByKeysInputType(detailedKeys, name, _schema) { | ||
var _this4 = this; | ||
return upperCamelCase(`update-${singularize(name)}-by-${detailedKeys.map(function (key) { | ||
return _this4.column(key.column, key.table, key.schema); | ||
}).join("-and-")}-input`); | ||
}, | ||
deleteByKeysInputType(detailedKeys, name, _schema) { | ||
var _this5 = this; | ||
return upperCamelCase(`delete-${singularize(name)}-by-${detailedKeys.map(function (key) { | ||
return _this5.column(key.column, key.table, key.schema); | ||
}).join("-and-")}-input`); | ||
}, | ||
updateNodeInputType(name, _schema) { | ||
return upperCamelCase(`update-${singularize(name)}-input`); | ||
}, | ||
deleteNodeInputType(name, _schema) { | ||
return upperCamelCase(`delete-${singularize(name)}-input`); | ||
}, | ||
manyRelationByKeys(detailedKeys, table, schema) { | ||
var _this6 = this; | ||
return camelCase(`${this.pluralize(this.tableName(table, schema))}-by-${detailedKeys.map(function (key) { | ||
return _this6.column(key.column, key.table, key.schema); | ||
}).join("-and-")}`); | ||
}, | ||
edge(typeName) { | ||
return upperCamelCase(`${pluralize(typeName)}-edge`); | ||
}, | ||
edgeField(name, _schema) { | ||
return camelCase(`${singularize(name)}-edge`); | ||
}, | ||
connection(typeName) { | ||
return upperCamelCase(`${this.pluralize(typeName)}-connection`); | ||
}, | ||
scalarFunctionConnection(procName, _procSchema) { | ||
return upperCamelCase(`${procName}-connection`); | ||
}, | ||
scalarFunctionEdge(procName, _procSchema) { | ||
return upperCamelCase(`${procName}-edge`); | ||
}, | ||
createField(name, _schema) { | ||
return camelCase(`create-${singularize(name)}`); | ||
}, | ||
createInputType(name, _schema) { | ||
return upperCamelCase(`create-${singularize(name)}-input`); | ||
}, | ||
createPayloadType(name, _schema) { | ||
return upperCamelCase(`create-${singularize(name)}-payload`); | ||
}, | ||
updatePayloadType(name, _schema) { | ||
return upperCamelCase(`update-${singularize(name)}-payload`); | ||
}, | ||
deletePayloadType(name, _schema) { | ||
return upperCamelCase(`delete-${singularize(name)}-payload`); | ||
} | ||
}, overrides); | ||
}; | ||
var postGraphQLInflection = exports.postGraphQLInflection = (0, _assign2.default)({}, defaultInflection, { | ||
enumName(value) { | ||
return (0, _utils.constantCase)(value); | ||
} | ||
}); | ||
var postGraphQLClassicIdsInflection = exports.postGraphQLClassicIdsInflection = (0, _assign2.default)({}, postGraphQLInflection, { | ||
column(name, _table, _schema) { | ||
return name === "id" ? "rowId" : (0, _utils.camelCase)(name); | ||
} | ||
}); | ||
var defaultInflection = exports.defaultInflection = newInflector(); | ||
//# sourceMappingURL=inflections.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.constantCase = exports.camelCase = exports.upperFirst = exports.formatInsideUnderscores = exports.constantCaseAll = exports.sqlJsonBuildObjectFromFragments = undefined; | ||
exports.upperCamelCase = exports.constantCase = exports.camelCase = exports.upperFirst = exports.formatInsideUnderscores = exports.constantCaseAll = exports.sqlJsonBuildObjectFromFragments = undefined; | ||
@@ -61,2 +61,5 @@ var _slicedToArray2 = require("babel-runtime/helpers/slicedToArray"); | ||
var constantCase = exports.constantCase = formatInsideUnderscores(constantCaseAll); | ||
var upperCamelCase = exports.upperCamelCase = function upperCamelCase(str) { | ||
return upperFirst(camelCase(str)); | ||
}; | ||
//# sourceMappingURL=utils.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.postGraphQLClassicIdsInflection = exports.postGraphQLInflection = exports.defaultInflection = undefined; | ||
exports.defaultInflection = exports.newInflector = exports.defaultUtils = undefined; | ||
@@ -21,15 +21,29 @@ var _assign = require("babel-runtime/core-js/object/assign"); | ||
const defaultInflection = exports.defaultInflection = { | ||
const defaultUtils = exports.defaultUtils = { | ||
constantCase: _utils.constantCase, | ||
camelCase: _utils.camelCase, | ||
upperCamelCase: _utils.upperCamelCase, | ||
pluralize: _pluralize2.default, | ||
singularize: _pluralize2.default.singular | ||
}; | ||
const newInflector = exports.newInflector = (overrides = undefined, { | ||
constantCase, | ||
camelCase, | ||
upperCamelCase, | ||
pluralize, | ||
singularize | ||
} = defaultUtils) => (0, _assign2.default)({ | ||
pluralize, | ||
argument(name, index) { | ||
return (0, _utils.camelCase)(name || `arg${index}`); | ||
return camelCase(name || `arg${index}`); | ||
}, | ||
orderByType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${(0, _pluralize2.default)(typeName)}-order-by`)); | ||
return upperCamelCase(`${pluralize(typeName)}-order-by`); | ||
}, | ||
orderByEnum(name, ascending, _table, _schema) { | ||
return (0, _utils.constantCase)(`${name}_${ascending ? "asc" : "desc"}`); | ||
return constantCase(`${name}_${ascending ? "asc" : "desc"}`); | ||
}, | ||
domainType(name) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(name)); | ||
return upperCamelCase(name); | ||
}, | ||
@@ -40,119 +54,109 @@ enumName(value) { | ||
enumType(name) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(name)); | ||
return upperCamelCase(name); | ||
}, | ||
conditionType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${typeName}-condition`)); | ||
return upperCamelCase(`${typeName}-condition`); | ||
}, | ||
inputType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${typeName}-input`)); | ||
return upperCamelCase(`${typeName}-input`); | ||
}, | ||
rangeBoundType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${typeName}-range-bound`)); | ||
return upperCamelCase(`${typeName}-range-bound`); | ||
}, | ||
rangeType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${typeName}-range`)); | ||
return upperCamelCase(`${typeName}-range`); | ||
}, | ||
patchType(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${typeName}-patch`)); | ||
return upperCamelCase(`${typeName}-patch`); | ||
}, | ||
patchField(itemName) { | ||
return (0, _utils.camelCase)(`${itemName}-patch`); | ||
return camelCase(`${itemName}-patch`); | ||
}, | ||
tableName(name, _schema) { | ||
return (0, _utils.camelCase)(_pluralize2.default.singular(name)); | ||
return camelCase(singularize(name)); | ||
}, | ||
tableNode(name, _schema) { | ||
return (0, _utils.camelCase)(_pluralize2.default.singular(name)); | ||
return camelCase(singularize(name)); | ||
}, | ||
allRows(name, schema) { | ||
return (0, _utils.camelCase)(`all-${this.pluralize(this.tableName(name, schema))}`); | ||
return camelCase(`all-${this.pluralize(this.tableName(name, schema))}`); | ||
}, | ||
functionName(name, _schema) { | ||
return (0, _utils.camelCase)(name); | ||
return camelCase(name); | ||
}, | ||
functionPayloadType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${name}-payload`)); | ||
return upperCamelCase(`${name}-payload`); | ||
}, | ||
functionInputType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${name}-input`)); | ||
return upperCamelCase(`${name}-input`); | ||
}, | ||
tableType(name, schema) { | ||
return (0, _utils.upperFirst)(this.tableName(name, schema)); | ||
return upperCamelCase(this.tableName(name, schema)); | ||
}, | ||
column(name, _table, _schema) { | ||
return (0, _utils.camelCase)(name); | ||
return camelCase(name); | ||
}, | ||
singleRelationByKeys(detailedKeys, table, schema) { | ||
return (0, _utils.camelCase)(`${this.tableName(table, schema)}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}`); | ||
return camelCase(`${this.tableName(table, schema)}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}`); | ||
}, | ||
updateByKeys(detailedKeys, table, schema) { | ||
return (0, _utils.camelCase)(`update-${this.tableName(table, schema)}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}`); | ||
return camelCase(`update-${this.tableName(table, schema)}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}`); | ||
}, | ||
deleteByKeys(detailedKeys, table, schema) { | ||
return (0, _utils.camelCase)(`delete-${this.tableName(table, schema)}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}`); | ||
return camelCase(`delete-${this.tableName(table, schema)}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}`); | ||
}, | ||
updateNode(name, _schema) { | ||
return (0, _utils.camelCase)(`update-${_pluralize2.default.singular(name)}`); | ||
return camelCase(`update-${singularize(name)}`); | ||
}, | ||
deleteNode(name, _schema) { | ||
return (0, _utils.camelCase)(`delete-${_pluralize2.default.singular(name)}`); | ||
return camelCase(`delete-${singularize(name)}`); | ||
}, | ||
updateByKeysInputType(detailedKeys, name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`update-${_pluralize2.default.singular(name)}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}-input`)); | ||
return upperCamelCase(`update-${singularize(name)}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}-input`); | ||
}, | ||
deleteByKeysInputType(detailedKeys, name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`delete-${_pluralize2.default.singular(name)}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}-input`)); | ||
return upperCamelCase(`delete-${singularize(name)}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}-input`); | ||
}, | ||
updateNodeInputType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`update-${_pluralize2.default.singular(name)}-input`)); | ||
return upperCamelCase(`update-${singularize(name)}-input`); | ||
}, | ||
deleteNodeInputType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`delete-${_pluralize2.default.singular(name)}-input`)); | ||
return upperCamelCase(`delete-${singularize(name)}-input`); | ||
}, | ||
manyRelationByKeys(detailedKeys, table, schema) { | ||
return (0, _utils.camelCase)(`${this.pluralize(this.tableName(table, schema))}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}`); | ||
return camelCase(`${this.pluralize(this.tableName(table, schema))}-by-${detailedKeys.map(key => this.column(key.column, key.table, key.schema)).join("-and-")}`); | ||
}, | ||
edge(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${(0, _pluralize2.default)(typeName)}-edge`)); | ||
return upperCamelCase(`${pluralize(typeName)}-edge`); | ||
}, | ||
edgeField(name, _schema) { | ||
return (0, _utils.camelCase)(`${_pluralize2.default.singular(name)}-edge`); | ||
return camelCase(`${singularize(name)}-edge`); | ||
}, | ||
connection(typeName) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${this.pluralize(typeName)}-connection`)); | ||
return upperCamelCase(`${this.pluralize(typeName)}-connection`); | ||
}, | ||
scalarFunctionConnection(procName, _procSchema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${procName}-connection`)); | ||
return upperCamelCase(`${procName}-connection`); | ||
}, | ||
scalarFunctionEdge(procName, _procSchema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`${procName}-edge`)); | ||
return upperCamelCase(`${procName}-edge`); | ||
}, | ||
createField(name, _schema) { | ||
return (0, _utils.camelCase)(`create-${_pluralize2.default.singular(name)}`); | ||
return camelCase(`create-${singularize(name)}`); | ||
}, | ||
createInputType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`create-${_pluralize2.default.singular(name)}-input`)); | ||
return upperCamelCase(`create-${singularize(name)}-input`); | ||
}, | ||
createPayloadType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`create-${_pluralize2.default.singular(name)}-payload`)); | ||
return upperCamelCase(`create-${singularize(name)}-payload`); | ||
}, | ||
updatePayloadType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`update-${_pluralize2.default.singular(name)}-payload`)); | ||
return upperCamelCase(`update-${singularize(name)}-payload`); | ||
}, | ||
deletePayloadType(name, _schema) { | ||
return (0, _utils.upperFirst)((0, _utils.camelCase)(`delete-${_pluralize2.default.singular(name)}-payload`)); | ||
return upperCamelCase(`delete-${singularize(name)}-payload`); | ||
} | ||
}; | ||
}, overrides); | ||
const postGraphQLInflection = exports.postGraphQLInflection = (0, _assign2.default)({}, defaultInflection, { | ||
enumName(value) { | ||
return (0, _utils.constantCase)(value); | ||
} | ||
}); | ||
const postGraphQLClassicIdsInflection = exports.postGraphQLClassicIdsInflection = (0, _assign2.default)({}, postGraphQLInflection, { | ||
column(name, _table, _schema) { | ||
return name === "id" ? "rowId" : (0, _utils.camelCase)(name); | ||
} | ||
}); | ||
const defaultInflection = exports.defaultInflection = newInflector(); | ||
//# sourceMappingURL=inflections.js.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.constantCase = exports.camelCase = exports.upperFirst = exports.formatInsideUnderscores = exports.constantCaseAll = exports.sqlJsonBuildObjectFromFragments = undefined; | ||
exports.upperCamelCase = exports.constantCase = exports.camelCase = exports.upperFirst = exports.formatInsideUnderscores = exports.constantCaseAll = exports.sqlJsonBuildObjectFromFragments = undefined; | ||
@@ -44,2 +44,3 @@ var _pgSql = require("pg-sql2"); | ||
const constantCase = exports.constantCase = formatInsideUnderscores(constantCaseAll); | ||
const upperCamelCase = exports.upperCamelCase = str => upperFirst(camelCase(str)); | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "graphile-build-pg", | ||
"version": "0.1.0-alpha.28", | ||
"version": "0.1.0-alpha.29", | ||
"description": "Build a GraphQL schema by reflection over a PostgreSQL schema. Easy to customize since it's built with plugins on graphile-build", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
1345771
9353