prisma-datamodel
Advanced tools
Comparing version 1.36.0-alpha.7 to 1.36.0-alpha.8
@@ -6,4 +6,7 @@ "use strict"; | ||
function getKind(field, enumMap) { | ||
if (typeof field.type === 'string' && scalar_1.isTypeIdentifier(field.type)) { | ||
return 'scalar'; | ||
if (typeof field.type === 'string') { | ||
if (scalar_1.isTypeIdentifier(field.type)) { | ||
return 'scalar'; | ||
} | ||
return undefined; | ||
} | ||
@@ -47,3 +50,3 @@ if (typeof field.type === 'string') { | ||
var models = isdl.types | ||
.filter(function (t) { return !t.isEnum; }) | ||
.filter(function (t) { return !t.isEnum && hasId(t); }) | ||
.map(function (type) { | ||
@@ -55,3 +58,3 @@ return { | ||
fields: type.fields | ||
.filter(function (f) { return f.type !== 'Json'; }) | ||
.filter(function (f) { return f.type !== 'Json' && getKind(f, enumMap); }) | ||
.map(function (field) { | ||
@@ -101,2 +104,5 @@ var kind = getKind(field, enumMap); | ||
exports.isdlToDmmfDatamodel = isdlToDmmfDatamodel; | ||
function hasId(type) { | ||
return type.fields.some(function (f) { return f.isId; }); | ||
} | ||
//# sourceMappingURL=isdlToDmmf.js.map |
{ | ||
"name": "prisma-datamodel", | ||
"version": "1.36.0-alpha.7", | ||
"version": "1.36.0-alpha.8", | ||
"description": "Transform prisma datamodel SDL into graphql-js SDL", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
217230
3585