prisma-nestjs-graphql 17.0.0 → 17.0.2

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.
Files changed (3) hide show
  1. package/README.md +2 -9
  2. package/index.js +16 -3
  3. package/package.json +43 -43
package/README.md CHANGED
@@ -10,16 +10,8 @@ Generate object types, inputs, args, etc. from prisma schema file for usage with
10
10
 
11
11
  ## Install
12
12
 
13
- Prisma v3
14
-
15
- ```sh
16
- npm install --save-dev prisma-nestjs-graphql
17
13
  ```
18
-
19
- Prisma v4
20
-
21
- ```
22
- npm install --save-dev prisma-nestjs-graphql@next
14
+ npm install --save-dev prisma-nestjs-graphql
23
15
  ```
24
16
 
25
17
  ## Usage
@@ -720,6 +712,7 @@ export class User {}
720
712
  - https://github.com/wSedlacek/prisma-generators/tree/master/libs/nestjs
721
713
  - https://github.com/EndyKaufman/typegraphql-prisma-nestjs
722
714
  - https://github.com/MichalLytek/typegraphql-prisma
715
+ - https://github.com/mk668a/nestjs-prisma-graphql-crud-gen
723
716
 
724
717
  ## Resources
725
718
 
package/index.js CHANGED
@@ -14,7 +14,10 @@ var __copyProps = (to, from, except, desc) => {
14
14
  }
15
15
  return to;
16
16
  };
17
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
19
+ mod
20
+ ));
18
21
 
19
22
  // src/index.ts
20
23
  var import_generator_helper = require("@prisma/generator-helper");
@@ -529,7 +532,9 @@ function getGraphqlInputType(inputTypes, pattern) {
529
532
  return result;
530
533
  }
531
534
  }
532
- throw new TypeError(`Cannot get matching input type from ${inputTypes.map((x) => x.type).join(", ") || "zero length inputTypes"}`);
535
+ throw new TypeError(
536
+ `Cannot get matching input type from ${inputTypes.map((x) => x.type).join(", ") || "zero length inputTypes"}`
537
+ );
533
538
  }
534
539
  __name(getGraphqlInputType, "getGraphqlInputType");
535
540
 
@@ -780,7 +785,7 @@ function inputType(args) {
780
785
  "updateMany",
781
786
  "upsert",
782
787
  "where"
783
- ].includes(name) || classTransformerTypeModels.has(getModelName2(graphqlType) || ""))) {
788
+ ].includes(name) || classTransformerTypeModels.has(getModelName2(graphqlType) || "") || modelField?.kind === "object" && models.get(modelField.type) && models.get(modelField.type)?.fields.some((field2) => field2.kind === "object" && classTransformerTypeModels.has(field2.type)))) {
784
789
  importDeclarations.add("Type", "class-transformer");
785
790
  property.decorators.push({
786
791
  name: "Type",
@@ -2017,6 +2022,14 @@ var endsWithKeywords = [
2017
2022
  "UpsertOne"
2018
2023
  ];
2019
2024
  var middleKeywords = [
2025
+ [
2026
+ "FindFirst",
2027
+ "OrThrowArgs"
2028
+ ],
2029
+ [
2030
+ "FindUnique",
2031
+ "OrThrowArgs"
2032
+ ],
2020
2033
  [
2021
2034
  "Aggregate",
2022
2035
  "Args"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prisma-nestjs-graphql",
3
- "version": "17.0.0",
3
+ "version": "17.0.2",
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",
@@ -52,7 +52,7 @@
52
52
  }
53
53
  },
54
54
  "dependencies": {
55
- "@prisma/generator-helper": "^4.0.0",
55
+ "@prisma/generator-helper": "^4.1.0",
56
56
  "await-event-emitter": "^2.0.2",
57
57
  "filenamify": "4.X",
58
58
  "flat": "^5.0.2",
@@ -62,69 +62,69 @@
62
62
  "outmatch": "^0.7.0",
63
63
  "pluralize": "^8.0.0",
64
64
  "pupa": "2.X",
65
- "ts-morph": ">=11"
65
+ "ts-morph": ">=11 <=16"
66
66
  },
67
67
  "devDependencies": {
68
- "@commitlint/cli": "^17.0.0",
69
- "@commitlint/config-conventional": "^17.0.0",
70
- "@nestjs/apollo": "^10.0.12",
71
- "@nestjs/common": "^8.4.5",
72
- "@nestjs/core": "^8.4.5",
73
- "@nestjs/graphql": "^10.0.12",
74
- "@nestjs/platform-express": "^8.4.5",
75
- "@paljs/plugins": "^4.1.0",
76
- "@prisma/client": "^4.0.0",
68
+ "@commitlint/cli": "^17.2.0",
69
+ "@commitlint/config-conventional": "^17.2.0",
70
+ "@nestjs/apollo": "^10.1.6",
71
+ "@nestjs/common": "^9.2.0",
72
+ "@nestjs/core": "^9.2.0",
73
+ "@nestjs/graphql": "^10.1.6",
74
+ "@nestjs/platform-express": "^9.2.0",
75
+ "@paljs/plugins": "^5.0.2",
76
+ "@prisma/client": "^4.1.0",
77
77
  "@semantic-release/changelog": "^6.0.1",
78
78
  "@semantic-release/git": "^10.0.1",
79
- "@swc/core": "^1.2.189",
80
- "@swc/helpers": "^0.3.13",
79
+ "@swc/core": "^1.3.19",
80
+ "@swc/helpers": "^0.4.14",
81
81
  "@swc/register": "^0.1.10",
82
82
  "@types/flat": "^5.0.2",
83
- "@types/lodash": "^4.14.182",
84
- "@types/mocha": "^9.1.1",
85
- "@types/node": "^17.0.35",
83
+ "@types/lodash": "^4.14.189",
84
+ "@types/mocha": "^10.0.0",
85
+ "@types/node": "^18.11.9",
86
86
  "@types/pluralize": "^0.0.29",
87
- "@typescript-eslint/eslint-plugin": "^5.25.0",
88
- "@typescript-eslint/parser": "^5.25.0",
89
- "apollo-server-express": "^3.7.0",
90
- "c8": "^7.11.3",
87
+ "@typescript-eslint/eslint-plugin": "^5.43.0",
88
+ "@typescript-eslint/parser": "^5.43.0",
89
+ "apollo-server-express": "^3.10.0",
90
+ "c8": "^7.12.0",
91
91
  "class-transformer": "^0.5.1",
92
92
  "class-validator": "^0.13.2",
93
- "commitizen": "^4.2.4",
94
- "cz-customizable": "^6.3.0",
95
- "decimal.js": "^10.3.1",
96
- "eslint": "^8.16.0",
93
+ "commitizen": "^4.2.5",
94
+ "cz-customizable": "^7.0.0",
95
+ "decimal.js": "^10.4.2",
96
+ "eslint": "^8.28.0",
97
97
  "eslint-import-resolver-node": "^0.3.6",
98
98
  "eslint-plugin-etc": "^2.0.2",
99
99
  "eslint-plugin-import": "^2.26.0",
100
100
  "eslint-plugin-only-warn": "^1.0.3",
101
- "eslint-plugin-prettier": "^4.0.0",
102
- "eslint-plugin-regexp": "^1.7.0",
103
- "eslint-plugin-simple-import-sort": "^7.0.0",
104
- "eslint-plugin-sort-class-members": "^1.14.1",
105
- "eslint-plugin-unicorn": "^42.0.0",
101
+ "eslint-plugin-prettier": "^4.2.1",
102
+ "eslint-plugin-regexp": "^1.10.0",
103
+ "eslint-plugin-simple-import-sort": "^8.0.0",
104
+ "eslint-plugin-sort-class-members": "^1.15.2",
105
+ "eslint-plugin-unicorn": "^44.0.2",
106
106
  "eslint-plugin-wix-editor": "^3.3.0",
107
- "expect": "^28.1.0",
107
+ "expect": "^29.3.1",
108
108
  "ghooks": "^2.0.4",
109
109
  "git-branch-is": "^4.0.0",
110
- "graphql": "^16.5.0",
111
- "graphql-scalars": "^1.17.0",
110
+ "graphql": "^16.6.0",
111
+ "graphql-scalars": "^1.20.1",
112
112
  "graphql-type-json": "^0.3.2",
113
- "mocha": "^10.0.0",
113
+ "mocha": "^10.1.0",
114
114
  "ololog": "^1.1.175",
115
115
  "precise-commits": "^1.0.2",
116
- "prettier": "^2.6.2",
117
- "prisma": "^4.0.0",
118
- "prisma-graphql-type-decimal": "^2.0.2",
116
+ "prettier": "^2.7.1",
117
+ "prisma": "^4.1.0",
118
+ "prisma-graphql-type-decimal": "^2.0.4",
119
119
  "reflect-metadata": "^0.1.13",
120
120
  "request": "^2.88.2",
121
- "rxjs": "^7.5.5",
122
- "semantic-release": "^19.0.2",
121
+ "rxjs": "^7.5.7",
122
+ "semantic-release": "^19.0.5",
123
123
  "simplytyped": "^3.3.0",
124
- "temp-dir": "^2.0.0",
125
- "ts-node": "^10.8.0",
126
- "tslib": "^2.4.0",
127
- "typescript": "^4.6.4",
124
+ "temp-dir": "2.X",
125
+ "ts-node": "^10.9.1",
126
+ "tslib": "^2.4.1",
127
+ "typescript": "^4.9.3",
128
128
  "watchexec-bin": "^1.0.0"
129
129
  }
130
130
  }