1.0.0 • Published 4 years ago

mikro-orm-graphql-example v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

mikro-orm-graphql-example

A MikroORM boilerplate for GraphQL made with Typescript using TypeGraphQL

📦 Packages


✨ Instalation

  1. Install dependencies via yarn
  2. Create your docker containers via docker-compose up -d
  3. create .env file based on .env.example
PORT=8080
POSTGRES_USER=root
POSTGRES_PASSWORD=root
POSTGRES_DB=mikro-orm-graphql-data
NODE_DEV=false
  1. Load fixtures yarn loadFixtures
  2. Run via yarn start or yarn dev
  3. GraphQL API is running on localhost:8080/graphql

⚡️ Usage

Running

Once the server starts, you can access the GraphQL API on localhost:8080/graphql.

I've included 4 options to run this application:

Run with Node

Run the regular start command

Run with ts-node-dev

Run and watch the application in Typescript. Checkout ts-node-dev

Run with debugger

I've added the launch script for VSCode in the repository. You can start the application by going to the Debug and Run tab and clicking on Debug Application

Test driven with Mocha Test Explorer

Mocha Test Explorer allows you to run and debug your mocha tests from a nice UI within VSCode. Install the extension and get going!

Mocha Test Explorer example

Migrations

After developing a feature, run the following commands to create a migration from the previous migration schema state:

yarn mikro-orm schema:drop --run
yarn mikro-orm migration:up
yarn mikro-orm migration:create

👤 Author

Dries Croons
Website: dries.io
Github: driescroons
Twitter: croewens


📢 Shoutouts

Special thanks to Leslie Jobse and Sebastiaan Viaene from Panenco.

At Panenco we shape, build & grow digital products from the ground up, with the future in mind.


⭐️ Support

Please start the repository if this helped you!


⛑️ Contribution

Want to help contribute to this repository?

  • Something's not working? Create an issue!
  • Missing some functionality? Feel free to create a pull request!

🚧 Todo

  • Better error handling