MichalLytek / MichalLytek/typegraphql-prisma

Generation is taking >4 minutes for a schema with 400 models

Open
#472 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
918
Forks
130
PR merge metrics
No merged PRs in 30d

Description

**Describe the Bug**
Generator typegraphql-prisma is taking >4 minutes compared to prisma client for a schema with >400 models while prisma client takes just under 1-2 seconds. Is this expected behaviour ?

**To Reproduce**
Run npx prisma generate on a schema with lot of models with below generator

```
generator typegraphql {
provider = "typegraphql-prisma"
useOriginalMapping = "true"
}
```

**Expected Behavior**
I would expect it to be taking just a few seconds to generate everything.

**Logs**

```
prisma:GeneratorProcess prisma:getDMMF Using getDmmf Wasm +2743ms +419ms
prisma:GeneratorProcess prisma:getDMMF Using given datamodel +0ms +1ms
prisma:GeneratorProcess prisma:getDMMF dmmf data retrieved without errors in getDmmf Wasm +799ms +798ms
prisma:cli:bin Execution time for executing "await cli.parse(commandArray)": 413122.55179190636 ms +408315ms

✔ Generated Prisma Client (v5.20.0) to ./../node_modules/@prisma/client in 1.68s

✔ Generated TypeGraphQL integration to ./../node_modules/@generated/type-graphql in 409.73s
```

**Environment (please complete the following information):**

OS: Mac M3

```
"@prisma/client": "^5.20.0",
"prisma": "^5.20.0",
"ts-node": "^10.9.2",
"type-graphql": "^2.0.0-rc.2",
"typegraphql-prisma": "^0.28.0"

```

**Additional Context**
Saw the same issue as closed here - [Issue](https://github.com/MichalLytek/typegraphql-prisma/issues/90)
I have tried the steps mentioned here but have not been able to bring the time down

Appreciate any help here , thanks in advance !

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with npx prisma generate, a schema containing more than 400 models, and the shown typegraphql generator configuration. Compare the Prisma Client and TypeGraphQL integration timings in the logs, then review the earlier issue 90 for relevant context. Done means identifying the cause of the 409.73-second generation time and implementing or documenting a measured improvement toward the expected few-second runtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.