You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
For my current project I'm using the version 7.
I'm not using any feature like: Guard, pipe, fieldMiddleware or FieldResolverEnhancers.
It's a big GraphQL API, with heavy payload.
Before NestJS, I was using TypeGraphQL.
Since we migrated to NestJS, we are facing performance issue, the query average duration increase of ~100ms.
I did a profiling, and we can see that the main "thread" is blocked by moment around 1,5sec. (See screenshots).
And we can see lot of call related to nestJS.
In a previous project, I've used NestJs version 6, where it use typeGraphQL for the graphQL part, and I didn't have this kind of issue.
But since the NestJS 7, the graphQL part was entirely rewrite in NestJS, and don't use anymore typeGraphQL.
Based on the screenshots you shared, it seems that you're using request-scoped resolvers and this is something that, inappropriately used, may be causing perf issues.
We can't really help you without the minimum reproduction repository. Can you please share one?
I'm submitting a...
[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
For my current project I'm using the version 7.
I'm not using any feature like: Guard, pipe, fieldMiddleware or FieldResolverEnhancers.
It's a big GraphQL API, with heavy payload.
Before NestJS, I was using TypeGraphQL.
Since we migrated to NestJS, we are facing performance issue, the query average duration increase of ~100ms.
I did a profiling, and we can see that the main "thread" is blocked by moment around 1,5sec. (See screenshots).
And we can see lot of call related to nestJS.
In a previous project, I've used NestJs version 6, where it use typeGraphQL for the graphQL part, and I didn't have this kind of issue.
But since the NestJS 7, the graphQL part was entirely rewrite in NestJS, and don't use anymore typeGraphQL.
So, that why, I decided to use the official TypeGraphQL module for nestJS: https://github.com/MichalLytek/typegraphql-nestjs
And now, with quite the exact same code (except the decorator import), I don't have performance issue anymore, and my CPU usage has been devided by 2.
May be we could add a
simpleResolvers
option toObjectType
like with typeGraphQL: (See: MichalLytek/type-graphql#488).I can provide an example of a ProcFile if needed.
Minimal reproduction of the problem with instructions
Query with resolver with big array of other resolver with lot of field.
What is the motivation / use case for changing the behavior?
Improve performance for big payload
Environment
The text was updated successfully, but these errors were encountered: