Member-only story

GraphQL + NodeJS + Postgres — Made easy with NestJS and TypeORM

Marcos Henrique da Silva
12 min readAug 9, 2021

--

In this article I will show you how to add a TypeORM module into our GraphQL backend project in a very, very, very easy way… using NestJS and TypeORM.

So I can reuse libraries? Yes

NestJS comes with an easy to use TypeORM module and in this article we are going to connect to a local Postgres database. Why Postgres? Because usually enterprises uses Postgres over Mysql even though TypeORM can work with any relational databases and … even Mongo (I still prefer mongoose though)

If you are lazy enough, in the end of article you can find all the source code in a public git repository.

To start, let’s checkout my previous project that I used in the previous article. My previous article, as it is can be found in my 001 branch.

Quick check-up:

  • I’m using node v14.16.1 when writing this article (I know… I need to update it)
  • Nest CLI version is: 8.1.1
  • npm version: 7.12.1
  • yarn version: 1.22.10 (I still like yarn over npm)

--

--

Responses (1)