This example demonstrates how to implement a GraphQL server with TypeScript based on Prisma & graphql-yoga.
Clone the repository:
git clone git@github.com:prisma/prisma-examples.git
Install Node dependencies:
cd prisma-examples/typescript-graphql
yarn install # or `npm install`
You will now deploy the Prisma API that's backing this example. This requires you to have Docker installed on your machine (if you don't have Docker follow the collapsed instructions below the code block):
docker-compose up -d
cd prisma
# provided as a script in package.json
yarn prisma deploy
I don't have Docker installed on my machine
To deploy your service to a Demo server (rather than locally with Docker), follow these steps:
- Run the following command:
yarn prisma deploy --new
- In the interactive CLI wizard:
- Select the Demo server
- For all following questions, choose the suggested values by just hitting Enter
yarn start
Navigate to http://localhost:4000 in your browser to explore the API of your GraphQL server in a GraphQL Playground.