-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: wip prisma gql select * feat: stronger api using decorator * feat: add PrismaSelect everywhere * fix: remove unused * fix: remove seed debug
- Loading branch information
Showing
35 changed files
with
1,080 additions
and
577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { getDMMF, getSchemaPath } = require('@prisma/internals'); | ||
|
||
async function generateTypes() { | ||
const schemaPath = await getSchemaPath(); | ||
const dmmf = await getDMMF({ | ||
datamodel: fs.readFileSync(schemaPath, 'utf-8'), | ||
}); | ||
|
||
let content = | ||
'// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n'; | ||
content += "import { Prisma } from '@prisma/client';\n\n"; | ||
content += 'export type ModelSelectMap = {\n'; | ||
|
||
for (const model of dmmf.datamodel.models) { | ||
content += ` ${model.name}: Prisma.${model.name}Select;\n`; | ||
} | ||
|
||
content += '};\n'; | ||
|
||
fs.writeFileSync( | ||
path.join(__dirname, '../src/utils/prisma-select/model-select-map.ts'), | ||
content, | ||
); | ||
} | ||
|
||
generateTypes().catch((e) => { | ||
console.error(e); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
server/src/core/comment/resolvers/comment-relations.resolver.spec.ts
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
server/src/core/comment/resolvers/comment-relations.resolver.ts
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
server/src/core/comment/resolvers/comment-thread-relations.resolver.spec.ts
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
server/src/core/comment/resolvers/comment-thread-relations.resolver.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.