ApolloServer instance takes 8sec to load on Node.js boot | IMPORTANT! #6215
Unanswered
georgekrax
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a Node.js powered by Express.js backend server, built on TypeScript. I use SWC to compile the
.ts
files, and it works gracefully in a few milliseconds. I also usenodemon
for restarting the Node.js server on change, which runs the script:node build/index.js
. However, even if use simply in cmd (without nodemon) the scriptnode build/index.js
, Node.js takes 10 seconds to boot -initialstartup.So, I started commenting out lines of code of my
src/index.ts
file, and saw that if I remove thenew ApolloServer()
instance, the initial boot time is 2 seconds! I do not know why is this happening, and it is really frustrating.I build my schema with the
nexus
package from Prisma, and it is large due to my application size, but not too big and complex.Beta Was this translation helpful? Give feedback.
All reactions