prisma-nestjs-graphql 18.1.0 → 18.1.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.
- package/README.md +6 -0
- package/generate.cjs +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -701,6 +701,12 @@ model User {
|
|
|
701
701
|
export class User {}
|
|
702
702
|
```
|
|
703
703
|
|
|
704
|
+
### Using lirary in other generators
|
|
705
|
+
|
|
706
|
+
```ts
|
|
707
|
+
import { generate } from 'prisma-nestjs-graphql/generate';
|
|
708
|
+
```
|
|
709
|
+
|
|
704
710
|
## Similar Projects
|
|
705
711
|
|
|
706
712
|
- https://github.com/jasonraimondi/prisma-generator-nestjs-graphql
|
package/generate.cjs
CHANGED
|
@@ -1801,11 +1801,11 @@ function getModelName(args) {
|
|
|
1801
1801
|
}
|
|
1802
1802
|
for (const [start, end] of middleKeywords) {
|
|
1803
1803
|
let test = name.slice(start.length).slice(0, -end.length);
|
|
1804
|
-
if (modelNames.includes(test)) {
|
|
1804
|
+
if (modelNames.includes(test) && name.startsWith(start) && name.endsWith(end)) {
|
|
1805
1805
|
return test;
|
|
1806
1806
|
}
|
|
1807
1807
|
test = name.slice(0, -(start + end).length);
|
|
1808
|
-
if (modelNames.includes(test)) {
|
|
1808
|
+
if (modelNames.includes(test) && name.endsWith(start + end)) {
|
|
1809
1809
|
return test;
|
|
1810
1810
|
}
|
|
1811
1811
|
}
|
|
@@ -1869,6 +1869,7 @@ const endsWithKeywords = [
|
|
|
1869
1869
|
"Aggregate",
|
|
1870
1870
|
"GroupBy",
|
|
1871
1871
|
"CreateOne",
|
|
1872
|
+
"CreateMany",
|
|
1872
1873
|
"DeleteMany",
|
|
1873
1874
|
"DeleteOne",
|
|
1874
1875
|
"FindMany",
|
|
@@ -1883,6 +1884,7 @@ const middleKeywords = [
|
|
|
1883
1884
|
["FindUnique", "OrThrowArgs"],
|
|
1884
1885
|
["Aggregate", "Args"],
|
|
1885
1886
|
["CreateOne", "Args"],
|
|
1887
|
+
["CreateMany", "Args"],
|
|
1886
1888
|
["DeleteMany", "Args"],
|
|
1887
1889
|
["DeleteOne", "Args"],
|
|
1888
1890
|
["FindMany", "Args"],
|
package/package.json
CHANGED