5 minutes GraphQL Environment Setup

An easy way to set up GraphQL Server with any database in under 5 minutes.

What is GraphQL, Apollo & Prisma?

As stated by Facebook in official documentation —

All you need to do is follow these steps and you are done.

Let’s get started —

Step 1: Open terminal or Powershell and navigate where you want to create a project. Now copy the command given below, paste it in the terminal and edit the [project name].

mkdir [project name] && cd [project name] && touch index.js && echo type Query {info: String!} > schema.graphql && echo const resolvers = {}; module.exports = resolvers; > resolvers.js && npm init -y && npm install apollo-server nodemon prisma && npx prisma init
Edited/Changed project name or folder name.
Edited/Changed project name or folder name.
Edited/Changed project name or folder name.
provider = “mysql”
model User {id Int @id @default(autoincrement())name String?
}
”mysql://[user_name]:[password]@localhost:3306/[database_name]”
npx prisma migrate dev && npx prisma generate
node index.jsnpx prisma studio
npx prisma migrate dev --name [migration name]npx prisma generate

Programming enthusiastic who aims to keep learning more and more things.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store