picker-hedgehog v0.0.5
Picker Hedgehog boilerplate
This example shows how to implement a GraphQL server with TypeScript based on Prisma Client, apollo-server. It is based on a SQLite database - you can find the database file with some dummy data at ./prisma/dev.db
.
Getting started
1. Install dependencies
Install npm dependencies:
npm install
2. Install Docker engine if you don't have it
Go to https://docs.docker.com/engine/install/ and install it to your machine
3. Add .env file into prisma directory with DATABASE_URL entry
DATABASE_URL=mysql://[your_db_username]:[your_db_password]@127.0.0.1:3306/picker
Go to https://docs.docker.com/engine/install/ and install it to your machine
4. If it's your first execution wake up the docker stack
This is only for local development. It simulates all necessary resources in order to develop connected to all the "real" services that project is connected to. Launch your local stack with the following command:
npm run create-local-stack
5. Start the GraphQL server
And finally launch your GraphQL server with this command:
npm run dev
Navigate to http://localhost:4000 in your browser to explore the API of your GraphQL server in a GraphQL Playground.
Using the GraphQL API
The schema specifies the API operations of your GraphQL server. TypeGraphQL allows you to define a schema using TypeScript classes and decorators. The schema is generated at runtime, and is defined by its classes
Below are a number of operations examples that you can send to the API using the GraphQL Playground.
Next steps
- Check out the Prisma docs
- Check out the Apollo docs
- Check out the TypeGraphQL docs