prisma-nestjs-graphql 15.3.2 → 15.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +9 -15
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1321,12 +1321,6 @@ function getExportDeclaration(name, statements) {
|
|
|
1321
1321
|
}
|
|
1322
1322
|
__name(getExportDeclaration, "getExportDeclaration");
|
|
1323
1323
|
|
|
1324
|
-
// src/helpers/is-list-input.ts
|
|
1325
|
-
function isListInput(typeName, model) {
|
|
1326
|
-
return typeName.startsWith(`${model}Create`) || typeName.startsWith(`${model}Update`);
|
|
1327
|
-
}
|
|
1328
|
-
__name(isListInput, "isListInput");
|
|
1329
|
-
|
|
1330
1324
|
// src/handlers/no-atomic-operations.ts
|
|
1331
1325
|
function noAtomicOperations(eventEmitter) {
|
|
1332
1326
|
eventEmitter.on("BeforeInputType", beforeInputType2);
|
|
@@ -1336,10 +1330,11 @@ __name(noAtomicOperations, "noAtomicOperations");
|
|
|
1336
1330
|
function beforeInputType2(args) {
|
|
1337
1331
|
const { inputType: inputType1, getModelName: getModelName2 } = args;
|
|
1338
1332
|
for (const field of inputType1.fields) {
|
|
1333
|
+
const fieldName = field.name;
|
|
1339
1334
|
field.inputTypes = field.inputTypes.filter((inputType2) => {
|
|
1340
1335
|
const inputTypeName = String(inputType2.type);
|
|
1341
1336
|
const modelName = getModelName2(inputTypeName);
|
|
1342
|
-
if (isAtomicOperation(inputTypeName) || modelName && isListInput(inputTypeName, modelName)) {
|
|
1337
|
+
if (isAtomicOperation(inputTypeName) || modelName && isListInput(inputTypeName, modelName, fieldName)) {
|
|
1343
1338
|
return false;
|
|
1344
1339
|
}
|
|
1345
1340
|
return true;
|
|
@@ -1365,6 +1360,10 @@ function isAtomicOperation(typeName) {
|
|
|
1365
1360
|
return false;
|
|
1366
1361
|
}
|
|
1367
1362
|
__name(isAtomicOperation, "isAtomicOperation");
|
|
1363
|
+
function isListInput(typeName, model, field) {
|
|
1364
|
+
return typeName === `${model}Create${field}Input` || typeName === `${model}Update${field}Input`;
|
|
1365
|
+
}
|
|
1366
|
+
__name(isListInput, "isListInput");
|
|
1368
1367
|
|
|
1369
1368
|
// src/handlers/output-type.ts
|
|
1370
1369
|
var import_assert4 = require("assert");
|
|
@@ -1931,13 +1930,6 @@ function getModelName(args) {
|
|
|
1931
1930
|
return test;
|
|
1932
1931
|
}
|
|
1933
1932
|
}
|
|
1934
|
-
if (name.slice(-5) === "Input") {
|
|
1935
|
-
for (const model of modelNames) {
|
|
1936
|
-
if (isListInput(name, model)) {
|
|
1937
|
-
return model;
|
|
1938
|
-
}
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
1933
|
return void 0;
|
|
1942
1934
|
}
|
|
1943
1935
|
__name(getModelName, "getModelName");
|
|
@@ -1980,7 +1972,9 @@ var splitKeywords = [
|
|
|
1980
1972
|
"SumOrderBy",
|
|
1981
1973
|
"MinOrderBy",
|
|
1982
1974
|
"MaxOrderBy",
|
|
1983
|
-
"AvgOrderBy"
|
|
1975
|
+
"AvgOrderBy",
|
|
1976
|
+
"Create",
|
|
1977
|
+
"Update"
|
|
1984
1978
|
].sort((a, b) => b.length - a.length);
|
|
1985
1979
|
var endsWithKeywords = [
|
|
1986
1980
|
"Aggregate",
|
package/package.json
CHANGED