Get Started

Setting up Prisma

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:

  1. Select Demo server from the list.
  2. When your browser opens, register with Prisma Cloud. This is needed because that's where the Demo server is hosted.
  3. Go back to your terminal.
  4. 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.

Create new user
Query all users
Update a user's name
Delete user
mutation {
  createUser(data: { name: "Alice" }) {
    id
  }
}
Copy
Great work! 👏 Move on to learn how you can extend your data model and make changes to your Prisma API.
Next Step