Get an GraphQL server using TypeGraphQL and PostgreSQL up and running in seconds.
-
Yarn v.1.22.4+.
-
PostgreSQL v.12.
-
Clone this repository.
-
Run
yarn install
on your terminal to get all the dependencies. -
Get your PostgreSQL services up and running.
-
Check the
ormconfig.json
file:
{
"name": "default",
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "<your-username>",
"password": "<your-password>",
"database": "<your-database-name>",
"synchronize": true,
"logging": true,
"entities": ["src/entity/*.*"]
}
- Keep in mind:
- Change the values in
<>
. - If you want to experiment and use another database, I would suggest checking TypeORM Documentation, and switching some configs out.
- Change the values in
-
Run the development server using:
yarn start
. -
Apollo server must be listening on:
http://localhost:4000/graphql
. -
Everything is setup so far, happy coding ๐.
-
Gives us phenomenal scale.
-
Easy to debug as everything go with the domain logic flow.
-
Easy to onboard a new developer to this codebase.
Read more here: Structure your Node js Apps