Goals
On this page, you will learn how to:
- Install the Prisma CLI
- Create a Prisma service configuration
- Deploy a Prisma service to a Demo server in Prisma Cloud
- Explore the Prisma API in a GraphQL Playground
Install the Prisma CLI
The Prisma CLI is used to deploy and manage Prisma services. You can install it using NPM:
npm install -g prisma
Copy
Create a Prisma service configuration
To bootstrap the configuration files for your first Prisma service, create a new directory and initalize it using the prisma init
command:
mkdir hello-world cd hello-world prisma init
Copy
After running prisma init
, the Prisma CLI prompts you to select how you want to deploy your Prisma service:
- Select Demo server from the list.
- When your browser opens, register with Prisma Cloud. This is needed because that's where the Demo server is hosted.
- Go back to your terminal.
- Choose the suggested values for all following questions by just hitting Enter until the interactive prompt terminates.
Deploy the Prisma service
The prisma init
command created the minimal service configuration needed to deploy a Prisma service: prisma.yml
and datamodel.graphql
. This service configuration now needs to be deployed so you can use the Prisma API of your service:
prisma deploy
Copy
Explore the Prisma API in a Playground
The Prisma API of your service exposes CRUD operations for the User
type defined in datamodel.graphql
. Here are a few sample queries and mutations you can send to explore the API.
mutation { createUser(data: { name: "Alice" }) { id } }
Copy