Home > Blockchain >  What is the best way to implement a GraphQL server in TypeScript?
What is the best way to implement a GraphQL server in TypeScript?

Time:09-16

Currently, I building a graphQL backend for a client using the following-

  • Node Express
  • Apollo server (apollo-server-express)
  • MongoDB (with Mongoose ORM)

They have decided to go with TypeScript instead of JavaScript to write the backend.

I am new to TypeScript so I wanted to know the best tools/packages which I can use. On doing some research online I found out that I can use TypeGraphQL. This package makes it really easy to work with GraphQL in TypeScript.

What is your opinion on this? It's a client's project so I wanted to be sure before moving forward with it. Or can you suggest me a better tool/packages which can go well with the above list of packages?

Any links to resources will also be helpful.

Thanks.

CodePudding user response:

You could create a script that generate GraphQL schema into types and write them into a single file. Then, you can import the types from the file where ever you need it. Also, you can pass the file to the frontend.

CodePudding user response:

You could use this popular node framework NestJS

  • Related