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
.
Install npm dependencies:
npm install
Go to https://docs.docker.com/engine/install/ and install it to your machine
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
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
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.
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.
- Check out the Prisma docs
- Check out the Apollo docs
- Check out the TypeGraphQL docs