prisma-nestjs-graphql 14.6.0 → 14.6.1

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 +4 -2
  2. package/index.js +10 -5
  3. package/package.json +34 -37
package/README.md CHANGED
@@ -128,10 +128,11 @@ Default: `false`
128
128
 
129
129
  #### `requireSingleFieldsInWhereUniqueInput`
130
130
 
131
- When a `Model`s `WhereUniqueInput` class has only a single field, mark that field as **required** (TypeScript) and **not nullable** (GraphQL).
131
+ When a model `*WhereUniqueInput` class has only a single field, mark that field as **required** (TypeScript) and **not nullable** (GraphQL).
132
132
  See [#58](https://github.com/unlight/prisma-nestjs-graphql/issues/58) for more details.
133
133
  Type: `boolean`
134
- Default: `false`
134
+ Default: `false`
135
+ **Note**: It will break compatiblity between Prisma types and generated classes.
135
136
 
136
137
  #### `useInputType`
137
138
 
@@ -635,6 +636,7 @@ export class User {}
635
636
 
636
637
  ## Similar Projects
637
638
 
639
+ - https://github.com/kimjbstar/prisma-class-generator
638
640
  - https://github.com/odroe/nest-gql-mix
639
641
  - https://github.com/rfermann/nestjs-prisma-graphql-generator
640
642
  - https://github.com/madscience/graphql-codegen-nestjs
package/index.js CHANGED
@@ -34,9 +34,6 @@ var __toModule = (module2) => {
34
34
  return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
35
35
  };
36
36
 
37
- // ../../../../.npm/_npx/7d72304e626f8399/node_modules/tsup/assets/cjs_shims.js
38
- var importMetaUrlShim = typeof document === "undefined" ? new (require("url")).URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
39
-
40
37
  // src/index.ts
41
38
  var import_generator_helper = __toModule(require("@prisma/generator-helper"));
42
39
 
@@ -612,7 +609,11 @@ function inputType(args) {
612
609
  getSourceFile
613
610
  });
614
611
  graphqlType = graphqlImport.name;
615
- if (graphqlImport.specifier && !importDeclarations.has(graphqlImport.name) && (graphqlImport.name !== inputType2.name && !shouldHideField || shouldHideField && propertyType[0] === graphqlImport.name)) {
612
+ let referenceName = propertyType[0];
613
+ if (location === "enumTypes") {
614
+ referenceName = (0, import_lodash3.last)(referenceName.split(" "));
615
+ }
616
+ if (graphqlImport.specifier && !importDeclarations.has(graphqlImport.name) && (graphqlImport.name !== inputType2.name && !shouldHideField || shouldHideField && referenceName === graphqlImport.name)) {
616
617
  importDeclarations.set(graphqlImport.name, {
617
618
  namedImports: [{ name: graphqlImport.name }],
618
619
  moduleSpecifier: graphqlImport.specifier
@@ -1190,7 +1191,11 @@ function outputType(outputType2, args) {
1190
1191
  getSourceFile
1191
1192
  });
1192
1193
  graphqlType = graphqlImport.name;
1193
- if (graphqlImport.specifier && !importDeclarations.has(graphqlImport.name) && (graphqlImport.name !== outputType2.name && !shouldHideField || shouldHideField && propertyType[0] === graphqlImport.name)) {
1194
+ let referenceName = propertyType[0];
1195
+ if (location === "enumTypes") {
1196
+ referenceName = (0, import_lodash6.last)(referenceName.split(" "));
1197
+ }
1198
+ if (graphqlImport.specifier && !importDeclarations.has(graphqlImport.name) && (graphqlImport.name !== outputType2.name && !shouldHideField || shouldHideField && referenceName === graphqlImport.name)) {
1194
1199
  importDeclarations.set(graphqlImport.name, {
1195
1200
  namedImports: [{ name: graphqlImport.name }],
1196
1201
  moduleSpecifier: graphqlImport.specifier
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prisma-nestjs-graphql",
3
- "version": "14.6.0",
3
+ "version": "14.6.1",
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",
@@ -47,12 +47,11 @@
47
47
  },
48
48
  "ghooks": {
49
49
  "pre-commit": "precise-commits",
50
- "commit-msg": "sh Taskfile commit_lint",
51
- "pre-push": "ultra test"
50
+ "commit-msg": "sh Taskfile commit_lint"
52
51
  }
53
52
  },
54
53
  "dependencies": {
55
- "@prisma/generator-helper": "^3.2.1",
54
+ "@prisma/generator-helper": "^3.5.0",
56
55
  "await-event-emitter": "^2.0.2",
57
56
  "filenamify": "4.X",
58
57
  "flat": "^5.0.2",
@@ -65,65 +64,63 @@
65
64
  "ts-morph": ">=11"
66
65
  },
67
66
  "devDependencies": {
68
- "@commitlint/cli": "^13.2.1",
69
- "@commitlint/config-conventional": "^13.2.0",
70
- "@nestjs/common": "^8.1.1",
71
- "@nestjs/core": "^8.1.1",
72
- "@nestjs/graphql": "^9.0.6",
73
- "@nestjs/platform-express": "^8.1.1",
67
+ "@commitlint/cli": "^15.0.0",
68
+ "@commitlint/config-conventional": "^15.0.0",
69
+ "@nestjs/common": "^8.2.3",
70
+ "@nestjs/core": "^8.2.3",
71
+ "@nestjs/graphql": "^9.1.2",
72
+ "@nestjs/platform-express": "^8.2.3",
74
73
  "@paljs/plugins": "^4.0.8",
75
- "@prisma/client": "^3.2.1",
76
- "@semantic-release/changelog": "^6.0.0",
77
- "@semantic-release/git": "^10.0.0",
74
+ "@prisma/client": "^3.5.0",
75
+ "@semantic-release/changelog": "^6.0.1",
76
+ "@semantic-release/git": "^10.0.1",
78
77
  "@types/flat": "^5.0.2",
79
- "@types/lodash": "^4.14.175",
78
+ "@types/lodash": "^4.14.177",
80
79
  "@types/mocha": "^9.0.0",
81
- "@types/node": "^16.11.0",
80
+ "@types/node": "^16.11.10",
82
81
  "@types/pluralize": "^0.0.29",
83
- "@typescript-eslint/eslint-plugin": "^4.33.0",
84
- "@typescript-eslint/parser": "^4.33.0",
85
- "apollo-server-express": "^3.4.0",
82
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
83
+ "@typescript-eslint/parser": "^5.4.0",
84
+ "apollo-server-express": "^3.5.0",
86
85
  "c8": "^7.10.0",
87
- "class-transformer": "^0.4.0",
88
- "class-validator": "^0.13.1",
86
+ "class-transformer": "^0.5.1",
87
+ "class-validator": "^0.13.2",
89
88
  "commitizen": "^4.2.4",
90
89
  "cz-customizable": "^6.3.0",
91
90
  "decimal.js": "^10.3.1",
92
- "eslint": "^7.32.0",
91
+ "eslint": "^8.3.0",
93
92
  "eslint-import-resolver-node": "^0.3.6",
94
- "eslint-plugin-etc": "^1.5.4",
95
- "eslint-plugin-import": "^2.25.2",
93
+ "eslint-plugin-etc": "^2.0.1",
94
+ "eslint-plugin-import": "^2.25.3",
96
95
  "eslint-plugin-only-warn": "^1.0.3",
97
96
  "eslint-plugin-prettier": "^4.0.0",
98
- "eslint-plugin-promise": "^5.1.0",
99
- "eslint-plugin-regexp": "^1.4.1",
97
+ "eslint-plugin-regexp": "^1.5.1",
100
98
  "eslint-plugin-simple-import-sort": "^7.0.0",
101
- "eslint-plugin-sonarjs": "^0.10.0",
102
- "eslint-plugin-sort-class-members": "^1.11.0",
103
- "eslint-plugin-total-functions": "^4.10.1",
104
- "eslint-plugin-unicorn": "^37.0.1",
99
+ "eslint-plugin-sort-class-members": "^1.14.0",
100
+ "eslint-plugin-unicorn": "^39.0.0",
105
101
  "eslint-plugin-wix-editor": "^3.3.0",
106
- "expect": "^27.2.5",
102
+ "expect": "^27.3.1",
107
103
  "ghooks": "^2.0.4",
108
104
  "git-branch-is": "^4.0.0",
109
- "graphql": "^15.6.1",
110
- "graphql-scalars": "^1.12.0",
105
+ "graphql": "^15.7.2",
106
+ "graphql-scalars": "^1.13.6",
111
107
  "graphql-type-json": "^0.3.2",
112
108
  "mocha": "^9.1.3",
113
109
  "ololog": "^1.1.175",
114
110
  "precise-commits": "^1.0.2",
115
- "prettier": "^2.4.1",
116
- "prisma": "^3.2.1",
111
+ "prettier": "^2.5.0",
112
+ "prisma": "^3.5.0",
117
113
  "prisma-graphql-type-decimal": "^1.0.0",
118
114
  "reflect-metadata": "^0.1.13",
115
+ "request": "^2.88.2",
119
116
  "rxjs": "^7.4.0",
120
- "semantic-release": "^18.0.0",
117
+ "semantic-release": "^18.0.1",
121
118
  "simplytyped": "^3.3.0",
122
119
  "temp-dir": "^2.0.0",
123
- "ts-node": "^10.3.0",
120
+ "ts-node": "^10.4.0",
124
121
  "ts-node-dev": "^1.1.8",
125
122
  "tslib": "^2.3.1",
126
- "typescript": "^4.4.4",
123
+ "typescript": "^4.5.2",
127
124
  "watchexec-bin": "^1.0.0"
128
125
  }
129
126
  }