You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### 2. Create GraphQL API with [`graphcool`](https://www.npmjs.com/package/graphcool)
15
-
16
-
If you haven't already, install the Graphcool CLI:
14
+
### 2. Deploy the Prisma database service
17
15
18
16
```sh
19
-
# Install Graphcool CLI
20
-
npm install -g graphcool
17
+
cd server
18
+
prisma deploy
19
+
```
20
+
21
+
> You can use the `prisma` CLI without having it globally installed because it's listed as a _development dependency_ in `package.json`.
22
+
23
+
When prompted where (i.e. to which _cluster_) you want to deploy your service, choose any of the public clusters, e.g. `public-us1` or `public-eu1`. (If you have Docker installed, you can also deploy locally.)
24
+
25
+
### 3. Set the Prisma service endpoint
26
+
27
+
From the output of the previous command, copy the `HTTP` endpoint and paste it into `src/index.js` where it's used to instantiate the `Prisma` binding. You need to replace the current placeholder `__PRISMA_ENDPOINT`:
28
+
29
+
```js
30
+
constserver=newGraphQLServer({
31
+
typeDefs:'./src/schema.graphql',
32
+
resolvers,
33
+
context:req=> ({
34
+
...req,
35
+
db:newPrisma({
36
+
typeDefs:'src/generated/prisma.graphql',
37
+
endpoint:"__PRISMA_ENDPOINT__",
38
+
secret:'mysecret123',
39
+
}),
40
+
}),
41
+
})
21
42
```
22
43
23
-
Once it's installed, you can start the GraphQL server:
0 commit comments