GraphQL Code Generator takes a lot of time to generate the result #8293
-
It takes almost 70-80 seconds for the code generation to happen whereas Apollo codegen used to take only 15 seconds.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
We cannot tell much because it depends on your schema's size, environment etc. That's why, we always ask for details and a reproduction repo or sandbox on GitHub, CodeSandbox or StackBlitz. |
Beta Was this translation helpful? Give feedback.
-
We did follow up with @nandita1 in private since performance is most of the time a project-specific topic; however, we recommend the following for large-scale projects:
schema: schema.graphql
documents:
- src/**/*.ts
generates:
src/generated/schema.ts:
config:
skipDocumentsValidation: true
plugins:
- "schema-ast"
src/generated/types.ts:
plugins:
- typescript
config:
skipDocumentsValidation: true
useTypeImports: true
nonOptionalTypename: true
scalars:
JSON: unknown
Number: number
|
Beta Was this translation helpful? Give feedback.
We did follow up with @nandita1 in private since performance is most of the time a project-specific topic; however, we recommend the following for large-scale projects:
skipDocumentsValidation
config flag as follows: