Skip to content

Commit cf97d3b

Browse files
Update app-manifest.mdx
1 parent 13efacf commit cf97d3b

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

modus/app-manifest.mdx

+46-1
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,59 @@ This connection type supports connecting to Dgraph databases. You can use the
254254
[Dgraph APIs](/modus/sdk/assemblyscript/dgraph) in the Modus SDK to interact
255255
with the database.
256256

257+
There are two ways to connect to Dgraph:
258+
259+
- [Using a connection string](#using-a-dgraph-connection-string) (preferred
260+
method)
261+
- [Using a gRPC target](#using-a-dgraph-grpc-target) (older method)
262+
263+
You can use either approach in Modus, but not both.
264+
265+
#### Using a Dgraph connection string
266+
267+
This is the preferred method for connecting to Dgraph. It uses a simplified URI
268+
based connection string to specify all options, including host, port, options,
269+
and authentication.
270+
271+
**Example:**
272+
273+
```json modus.json
274+
{
275+
"connections": {
276+
"my-dgraph": {
277+
"type": "dgraph",
278+
"connString": "dgraph://example.hypermode.host:443?sslmode=verify-ca&bearertoken={{DGRAPH_API_KEY}}"
279+
}
280+
}
281+
}
282+
```
283+
284+
<ResponseField name="type" type="string" required>
285+
Always set to `"dgraph"` for this connection type.
286+
</ResponseField>
287+
288+
<ResponseField name="connString" type="string" required>
289+
The connection string for the Dgraph database, in URI format.
290+
</ResponseField>
291+
292+
#### Using a Dgraph gRPC target
293+
294+
This is the older method for connecting to Dgraph. It uses a gRPC target to
295+
specify the host and port, and a separate key for authentication. It
296+
automatically uses SSL mode (with full CA verification) for the connection -
297+
_except_ when connecting to `localhost`.
298+
299+
Additional options such as username/password authentication aren't supported. If
300+
you need to use these options, use the connection string method instead.
301+
257302
**Example:**
258303

259304
```json modus.json
260305
{
261306
"connections": {
262307
"my-dgraph": {
263308
"type": "dgraph",
264-
"grpcTarget": "frozen-mango.grpc.eu-central-1.aws.cloud.dgraph.io:443",
309+
"grpcTarget": "example.grpc.region.aws.cloud.dgraph.io:443",
265310
"key": "{{DGRAPH_API_KEY}}"
266311
}
267312
}

0 commit comments

Comments
 (0)