This is a quick start guide to setting up a GraphQL API using Express, Apollo Server, Prisma, Heroku, Postgres, Docker and TypeScript. When we're

How to setup & deploy an Express GraphQL server with Apollo, Prisma, TypeScript, Postgres & Heroku

submited by
Style Pass
2021-08-20 12:30:03

This is a quick start guide to setting up a GraphQL API using Express, Apollo Server, Prisma, Heroku, Postgres, Docker and TypeScript.

When we're done, we'll have a GraphQL server that can be used by a front end to query and persist data from a Postres database.

Jump into your terminal, create the directory and push the code up to a new repository in Github. You can skip this section if you're familiar with this process.

Next, we need to add a tsconfig.json file which sets our TypeScript compiler options. First, add the file to the root of your project:

Take a look at the docs if you'd like to learn what each configuration means and if you'd like to add more configuration options.

Hot reloading in your local set up is fundamental to a decent developer experience. Otherwise you'll need to quit and restart the server everytime you make changes to your code.

nodemon watches for any changes in your code and restarts the server automatically, while ts-node enables the server to understand TypeScript directly (removing the requirement for compiling).

Leave a Comment