Skip to content

Commit 697cf0c

Browse files
committed
Add debug mode documentation in the README
1 parent 6bf8c5c commit 697cf0c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and understand how to run and work with Dgraph.
2424
* [Run a mutation](#run-a-mutation)
2525
* [Run a query](#run-a-query)
2626
* [Commit a transaction](#commit-a-transaction)
27+
* [Debug mode](#debug-mode)
2728
- [Development](#development)
2829
* [Building the source](#building-the-source)
2930
* [Running tests](#running-tests)
@@ -67,6 +68,8 @@ const clientStub = new dgraph.DgraphClientStub(
6768
const dgraphClient = new dgraph.DgraphClient(clientStub);
6869
```
6970

71+
To facilitate debugging, [debug mode](#debug-mode) can be enabled for a client.
72+
7073
### Alter the database
7174
To set the schema, create an `Operation` object, set the schema and pass it to
7275
`DgraphClient#alter(Operation)` method.
@@ -230,6 +233,23 @@ try {
230233
}
231234
```
232235

236+
### Debug mode
237+
Debug mode can be used to print helpful debug messages while performing alters,
238+
queries and mutations. It can be set using the`DgraphClient#setDebugMode(boolean?)`
239+
method.
240+
241+
```js
242+
// Create a client.
243+
const dgraphClient = new dgraph.DgraphClient(...);
244+
245+
// Enable debug mode.
246+
dgraphClient.setDebugMode(true);
247+
// OR simply dgraphClient.setDebugMode();
248+
249+
// Disable debug mode.
250+
dgraphClient.setDebugMode(false);
251+
```
252+
233253
## Development
234254

235255
### Building the source

0 commit comments

Comments
 (0)