title: Investigate performance of response serialization with nestjs and graphql
body: <p>I am looking into a performance issue with serialization in a nodejs backend. I would like some suggestions about how to investigate what is happening after that the app logic in the service has returned its response.</p>
  <p>Currently there is a bad query executed with typeorm that returns about 12000 rows. The speed of this query is not a problem, but when the result is returned from the service, it takes about 100 seconds for the api to actually return the response. The application is using nestjs with graphql as api.</p>
  <p>I guess that there is some heavy serialization done either in apollo server or in nestjs. How do I investigate this further? And is the large size of the database query the only issue here, or could it be something else?</p>
  <p>The real problem here is that this is blocking the event loop of nodejs for about 100 seconds, which freezes the whole backend.</p>