prisma-nestjs-graphql 15.2.2 → 15.2.5
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/README.md +1 -1
- package/index.js +5 -1
- package/package.json +26 -26
package/README.md
CHANGED
|
@@ -659,7 +659,7 @@ export class User {}
|
|
|
659
659
|
## Resources
|
|
660
660
|
|
|
661
661
|
- Todo - https://github.com/unlight/prisma-nestjs-graphql/issues/2
|
|
662
|
-
- https://github.com/prisma/prisma/blob/
|
|
662
|
+
- https://github.com/prisma/prisma/blob/main/packages/client/src/generation/TSClient/TSClient.ts
|
|
663
663
|
- https://ts-ast-viewer.com/
|
|
664
664
|
- https://github.com/unlight/nestjs-graphql-prisma-realworld-example-app
|
|
665
665
|
- https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema/data-model
|
package/index.js
CHANGED
|
@@ -494,6 +494,7 @@ function getGraphqlInputType(inputTypes, pattern) {
|
|
|
494
494
|
"null",
|
|
495
495
|
"Null"
|
|
496
496
|
].includes(String(t.type)));
|
|
497
|
+
inputTypes = (0, import_lodash2.uniqWith)(inputTypes, import_lodash2.isEqual);
|
|
497
498
|
if (inputTypes.length === 1) {
|
|
498
499
|
return inputTypes[0];
|
|
499
500
|
}
|
|
@@ -724,7 +725,7 @@ function inputType(args) {
|
|
|
724
725
|
if (location === "enumTypes") {
|
|
725
726
|
referenceName = (0, import_lodash3.last)(referenceName.split(" "));
|
|
726
727
|
}
|
|
727
|
-
if (graphqlImport.specifier && !importDeclarations.has(graphqlImport.name) &&
|
|
728
|
+
if (graphqlImport.specifier && !importDeclarations.has(graphqlImport.name) && graphqlImport.name !== inputType1.name) {
|
|
728
729
|
importDeclarations.set(graphqlImport.name, {
|
|
729
730
|
namedImports: [
|
|
730
731
|
{
|
|
@@ -2042,6 +2043,9 @@ async function generate(args) {
|
|
|
2042
2043
|
for (const model of datamodel.models) {
|
|
2043
2044
|
await eventEmitter.emit("Model", model, eventArguments);
|
|
2044
2045
|
}
|
|
2046
|
+
for (const model1 of datamodel.types) {
|
|
2047
|
+
await eventEmitter.emit("Model", model1, eventArguments);
|
|
2048
|
+
}
|
|
2045
2049
|
await eventEmitter.emit("PostBegin", eventArguments);
|
|
2046
2050
|
for (const enumType of enumTypes.prisma.concat(enumTypes.model || [])) {
|
|
2047
2051
|
await eventEmitter.emit("EnumType", enumType, eventArguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prisma-nestjs-graphql",
|
|
3
|
-
"version": "15.2.
|
|
3
|
+
"version": "15.2.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Generate object types, inputs, args, etc. from prisma schema file for usage with @nestjs/graphql module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
24
|
"test": "npm run eslint && npm run tscheck && npm run test:cov",
|
|
25
|
-
"mocha": "node node_modules/mocha/bin/
|
|
26
|
-
"test:r": "mocha -r
|
|
25
|
+
"mocha": "node node_modules/mocha/bin/mocha",
|
|
26
|
+
"test:r": "npm run mocha -- -r ts-node/register src/**/*.spec.ts",
|
|
27
27
|
"test:cov": "c8 --reporter text --exclude \"**/*.spec.ts\" --exclude \"**/test/**\" npm run test:r -- --no-timeouts",
|
|
28
|
-
"test:w": "
|
|
28
|
+
"test:w": "npm run test:r -- --watch-files src --watch --timeout=10s",
|
|
29
29
|
"test:d": "ndb -r @swc/register node_modules/mocha/bin/_mocha --no-timeouts --watch-files src/**/*.ts --watch src/**/*.spec.ts",
|
|
30
30
|
"tscheck": "tsc --noEmit",
|
|
31
31
|
"tscheck:w": "npm run tscheck -- --watch",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@nestjs/apollo": "^10.0.
|
|
55
|
-
"@prisma/generator-helper": "^3.
|
|
54
|
+
"@nestjs/apollo": "^10.0.9",
|
|
55
|
+
"@prisma/generator-helper": "^3.13.0",
|
|
56
56
|
"await-event-emitter": "^2.0.2",
|
|
57
57
|
"filenamify": "4.X",
|
|
58
58
|
"flat": "^5.0.2",
|
|
@@ -65,55 +65,55 @@
|
|
|
65
65
|
"ts-morph": ">=11"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@commitlint/cli": "^16.2.
|
|
69
|
-
"@commitlint/config-conventional": "^16.2.
|
|
68
|
+
"@commitlint/cli": "^16.2.4",
|
|
69
|
+
"@commitlint/config-conventional": "^16.2.4",
|
|
70
70
|
"@nestjs/common": "^8.4.4",
|
|
71
71
|
"@nestjs/core": "^8.4.4",
|
|
72
|
-
"@nestjs/graphql": "^10.0.
|
|
72
|
+
"@nestjs/graphql": "^10.0.10",
|
|
73
73
|
"@nestjs/platform-express": "^8.4.4",
|
|
74
74
|
"@paljs/plugins": "^4.0.18",
|
|
75
|
-
"@prisma/client": "^3.
|
|
75
|
+
"@prisma/client": "^3.13.0",
|
|
76
76
|
"@semantic-release/changelog": "^6.0.1",
|
|
77
77
|
"@semantic-release/git": "^10.0.1",
|
|
78
|
-
"@swc/core": "^1.2.
|
|
79
|
-
"@swc/helpers": "^0.3.
|
|
78
|
+
"@swc/core": "^1.2.174",
|
|
79
|
+
"@swc/helpers": "^0.3.10",
|
|
80
80
|
"@swc/register": "^0.1.10",
|
|
81
81
|
"@types/flat": "^5.0.2",
|
|
82
|
-
"@types/lodash": "^4.14.
|
|
83
|
-
"@types/mocha": "^9.1.
|
|
84
|
-
"@types/node": "^17.0.
|
|
82
|
+
"@types/lodash": "^4.14.182",
|
|
83
|
+
"@types/mocha": "^9.1.1",
|
|
84
|
+
"@types/node": "^17.0.31",
|
|
85
85
|
"@types/pluralize": "^0.0.29",
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
87
|
-
"@typescript-eslint/parser": "^5.
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^5.21.0",
|
|
87
|
+
"@typescript-eslint/parser": "^5.21.0",
|
|
88
88
|
"apollo-server-express": "^3.6.7",
|
|
89
|
-
"c8": "^7.11.
|
|
89
|
+
"c8": "^7.11.2",
|
|
90
90
|
"class-transformer": "^0.5.1",
|
|
91
91
|
"class-validator": "^0.13.2",
|
|
92
92
|
"commitizen": "^4.2.4",
|
|
93
93
|
"cz-customizable": "^6.3.0",
|
|
94
94
|
"decimal.js": "^10.3.1",
|
|
95
|
-
"eslint": "^8.
|
|
95
|
+
"eslint": "^8.14.0",
|
|
96
96
|
"eslint-import-resolver-node": "^0.3.6",
|
|
97
97
|
"eslint-plugin-etc": "^2.0.2",
|
|
98
98
|
"eslint-plugin-import": "^2.26.0",
|
|
99
99
|
"eslint-plugin-only-warn": "^1.0.3",
|
|
100
100
|
"eslint-plugin-prettier": "^4.0.0",
|
|
101
|
-
"eslint-plugin-regexp": "^1.
|
|
101
|
+
"eslint-plugin-regexp": "^1.7.0",
|
|
102
102
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
103
103
|
"eslint-plugin-sort-class-members": "^1.14.1",
|
|
104
104
|
"eslint-plugin-unicorn": "^42.0.0",
|
|
105
105
|
"eslint-plugin-wix-editor": "^3.3.0",
|
|
106
|
-
"expect": "^
|
|
106
|
+
"expect": "^28.0.2",
|
|
107
107
|
"ghooks": "^2.0.4",
|
|
108
108
|
"git-branch-is": "^4.0.0",
|
|
109
|
-
"graphql": "^16.
|
|
109
|
+
"graphql": "^16.4.0",
|
|
110
110
|
"graphql-scalars": "^1.17.0",
|
|
111
111
|
"graphql-type-json": "^0.3.2",
|
|
112
|
-
"mocha": "^
|
|
112
|
+
"mocha": "^10.0.0",
|
|
113
113
|
"ololog": "^1.1.175",
|
|
114
114
|
"precise-commits": "^1.0.2",
|
|
115
115
|
"prettier": "^2.6.2",
|
|
116
|
-
"prisma": "^3.
|
|
116
|
+
"prisma": "^3.13.0",
|
|
117
117
|
"prisma-graphql-type-decimal": "^2.0.0",
|
|
118
118
|
"reflect-metadata": "^0.1.13",
|
|
119
119
|
"request": "^2.88.2",
|
|
@@ -123,8 +123,8 @@
|
|
|
123
123
|
"temp-dir": "^2.0.0",
|
|
124
124
|
"ts-node": "^10.7.0",
|
|
125
125
|
"ts-node-dev": "^1.1.8",
|
|
126
|
-
"tslib": "^2.
|
|
127
|
-
"typescript": "^4.6.
|
|
126
|
+
"tslib": "^2.4.0",
|
|
127
|
+
"typescript": "^4.6.4",
|
|
128
128
|
"watchexec-bin": "^1.0.0"
|
|
129
129
|
}
|
|
130
130
|
}
|