prisma-generate-schema
Advanced tools
Comparing version 1.31.0-beta.3 to 1.31.0-beta.4
import { DatabaseType } from 'prisma-datamodel'; | ||
export default function blackBoxTest(name: string, databaseType: DatabaseType, filePrefix: string, v11?: boolean): void; | ||
export default function blackBoxTest(name: string, databaseType: DatabaseType, filePrefix: string): void; |
@@ -9,5 +9,5 @@ "use strict"; | ||
var path = require("path"); | ||
function blackBoxTest(name, databaseType, filePrefix, v11) { | ||
function blackBoxTest(name, databaseType, filePrefix) { | ||
var generator = generator_1.default.create(databaseType); | ||
var modelPath = path.join(__dirname, "cases/" + name + "/model_" + filePrefix + (v11 ? '_v1.1' : '') + ".graphql"); | ||
var modelPath = path.join(__dirname, "cases/" + name + "/model_" + filePrefix + ".graphql"); | ||
var prismaPath = path.join(__dirname, "cases/" + name + "/" + filePrefix + ".graphql"); | ||
@@ -35,3 +35,3 @@ expect(fs.existsSync(modelPath)); | ||
test("Generates schema for " + testName + "/relational correctly", function () { | ||
blackBoxTest(testName, prisma_datamodel_1.DatabaseType.postgres, 'relational', true); | ||
blackBoxTest(testName, prisma_datamodel_1.DatabaseType.postgres, 'relational_v1.1'); | ||
}); | ||
@@ -38,0 +38,0 @@ test("Generates schema for " + testName + "/document correctly", function () { |
@@ -73,5 +73,7 @@ "use strict"; | ||
ModelCreateInputGenerator.generateScalarFieldTypeForInputType = function (model, field, generators) { | ||
if (field.isReadOnly && | ||
if ((field.isReadOnly && | ||
!(field.idStrategy === prisma_datamodel_1.IdStrategy.Auto || | ||
field.idStrategy === prisma_datamodel_1.IdStrategy.None)) { | ||
field.idStrategy === prisma_datamodel_1.IdStrategy.None)) || | ||
field.isCreatedAt || | ||
field.isUpdatedAt) { | ||
return null; | ||
@@ -78,0 +80,0 @@ } |
@@ -23,3 +23,3 @@ "use strict"; | ||
ModelUpdateInputGenerator.generateScalarFieldTypeForInputType = function (model, field, generators) { | ||
if (field.isReadOnly) { | ||
if (field.isReadOnly || field.isCreatedAt || field.isUpdatedAt) { | ||
return null; | ||
@@ -26,0 +26,0 @@ } |
@@ -37,9 +37,2 @@ "use strict"; | ||
} | ||
// These fields are always present on relational moels. | ||
values.id_ASC = {}; | ||
values.id_DESC = {}; | ||
values.createdAt_ASC = {}; | ||
values.createdAt_DESC = {}; | ||
values.updatedAt_ASC = {}; | ||
values.updatedAt_DESC = {}; | ||
return new type_1.GraphQLEnumType({ | ||
@@ -46,0 +39,0 @@ name: this.getTypeName(input, args), |
{ | ||
"name": "prisma-generate-schema", | ||
"version": "1.31.0-beta.3", | ||
"version": "1.31.0-beta.4", | ||
"description": "Transform prisma datamodel SDL into graphql-js SDL", | ||
@@ -30,3 +30,3 @@ "main": "dist/src/index.js", | ||
"popsicle": "10", | ||
"prisma-datamodel": "1.31.0-beta.3" | ||
"prisma-datamodel": "1.31.0-beta.4" | ||
}, | ||
@@ -40,3 +40,4 @@ "jest": { | ||
"/node_modules/", | ||
"helpers.ts" | ||
"helpers.ts", | ||
"sandbox.ts" | ||
], | ||
@@ -43,0 +44,0 @@ "moduleFileExtensions": [ |
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
330111
4636
+ Addedprisma-datamodel@1.31.0-beta.4(transitive)
- Removedprisma-datamodel@1.31.0-beta.3(transitive)