Skip to content

Commit 851b60b

Browse files
fix example
1 parent 3638e05 commit 851b60b

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Using the `open` function with a connection string:
8080

8181
```js
8282
// open a connection to an ACL-enabled, non-TLS cluster and login as groot
83-
const client = dgraph.open("dgraph://groot:password@localhost:8090")
83+
const client = await dgraph.open("dgraph://groot:password@localhost:8090")
8484
// Use the client
8585

8686
// this will close all the client stubs
@@ -381,7 +381,7 @@ const SERVER_ADDR = "localhost:9080"
381381
const SERVER_CREDENTIALS = grpc.credentials.createInsecure()
382382

383383
// Create instances of DgraphClient.
384-
const client = dgraph.open("dgraph://groot:password@${SERVER_ADDR}")
384+
const client = await dgraph.open("dgraph://groot:password@${SERVER_ADDR}")
385385

386386
// ...
387387
// Use dgraphClient

examples/simple/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ async function queryData(dgraphClient) {
115115
}
116116

117117
async function main() {
118-
const dgraphClient = dgraph.open()
118+
const dgraphClient = await dgraph.open()
119119
await dropAll(dgraphClient)
120120
await setSchema(dgraphClient)
121121
await createData(dgraphClient)

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "dgraph-js",
33
"version": "24.1.0",
4-
"type": "module",
54
"description": "Official javascript client for Dgraph",
65
"license": "Apache-2.0",
76
"repository": {

0 commit comments

Comments
 (0)