@8base/utils
Advanced tools
Comparing version 0.16.9 to 0.16.10
@@ -10,3 +10,3 @@ "use strict"; | ||
}); | ||
exports.createTableRowDeleteTag = exports.createTableRowQueryTag = exports.createTableRowUpdateTag = exports.createTableRowCreateTag = exports.createTableFilterGraphqlTag = void 0; | ||
exports.createTableRowDeleteTag = exports.createTableRowQueryTag = exports.createTableRowUpdateTag = exports.createTableRowCreateManyTag = exports.createTableRowCreateTag = exports.createTableFilterGraphqlTag = void 0; | ||
@@ -78,2 +78,15 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread")); | ||
var createTableRowCreateManyTag = function createTableRowCreateManyTag(tablesList, tableName) { | ||
var table = getTableByName(tablesList, tableName); | ||
var hasNonMetaFields = tableSelectors.hasNonMetaFields(table); | ||
if (hasNonMetaFields) { | ||
return "\n mutation DataViewer".concat(upperFirst(tableName), "RowCreateMany($data: [").concat(_schemaNameGenerator.SchemaNameGenerator.getCreateManyInputName(tableName), "]!) {\n ").concat(_schemaNameGenerator.SchemaNameGenerator.getCreateManyItemFieldName(tableName), "(data: $data) {\n count\n }\n }"); | ||
} | ||
return "\n mutation DataViewer".concat(upperFirst(tableName), "RowCreateMany {\n ").concat(_schemaNameGenerator.SchemaNameGenerator.getCreateManyItemFieldName(tableName), " {\n count\n }\n }"); | ||
}; | ||
exports.createTableRowCreateManyTag = createTableRowCreateManyTag; | ||
var createTableRowUpdateTag = function createTableRowUpdateTag(tablesList, tableName) { | ||
@@ -80,0 +93,0 @@ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
{ | ||
"name": "@8base/utils", | ||
"version": "0.16.9", | ||
"version": "0.16.10", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
@@ -86,2 +86,23 @@ // @flow | ||
export const createTableRowCreateManyTag = (tablesList: TableSchema[], tableName: string) => { | ||
const table = getTableByName(tablesList, tableName); | ||
const hasNonMetaFields = tableSelectors.hasNonMetaFields(table); | ||
if (hasNonMetaFields) { | ||
return ` | ||
mutation DataViewer${upperFirst(tableName)}RowCreateMany($data: [${SchemaNameGenerator.getCreateManyInputName(tableName)}]!) { | ||
${SchemaNameGenerator.getCreateManyItemFieldName(tableName)}(data: $data) { | ||
count | ||
} | ||
}`; | ||
} | ||
return ` | ||
mutation DataViewer${upperFirst(tableName)}RowCreateMany { | ||
${SchemaNameGenerator.getCreateManyItemFieldName(tableName)} { | ||
count | ||
} | ||
}`; | ||
}; | ||
export const createTableRowUpdateTag = (tablesList: TableSchema[], tableName: string, config: QueryGeneratorConfig = {}) => ` | ||
@@ -88,0 +109,0 @@ mutation DataViewer${upperFirst(tableName)}RowUpdate($data: ${SchemaNameGenerator.getUpdateInputName(tableName)}!, $filter: ${SchemaNameGenerator.getKeyFilterInputTypeName(tableName)}) { |
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
415087
3433