nestjs-mysql-rest-and-typegraphql
This is a little example of how to use nest.js creating a REST and GraphQL API using Type-GraphQL.
Generate new module:
nest g module MODULE_NAME
nest g controller CONTROLLER_NAME # This is for REST api
nest g service SERVICE_NAME
nest g resolver RESOLVER_NAME # This is for GraphQL api
Update all the packages:
yarn upgrade-interactive --latest
We are defining the root password to “ChangeIt” on the exemple below
docker run --name mysqldev -e MYSQL_ROOT_PASSWORD=ChangeIt -d -p3306:3306 mysql:5.6
Testing
docker exec -it mysqldev bash
mysql -uroot -p