Availability
As we prepare for the general availability, weβre making a set of preview releases available for use on Hypermode and locally. The fastest way to get started is to sign up for a free Hypermode account. The run locally, use the Docker imagedgraph/standalone:v25.0.0-preview6.
Features
The following new features are currently available in the preview release:- Namespaces β logically isolate environments for multi-customer apps
- v2 APIs β write less code with simplified client creation and DQL execution
- Model Context Protocol (MCP) Server β stay in flow by making your Dgraph schema and queries available to your AI coding assistants
- Backups (formerly Binary Backups β non-S3 support has been dropped due to the deprecation of MinIO Gateway and is planned for a future release)
- Query Logs (formerly Audit Logs)
- Database Encryption (formerly Encryption at Rest)
- Learner Nodes
- Change Data Capture
Namespaces
Namespaces allow you to create logically separated environments for your data, enabling multi-customer apps without the overhead of managing a database per customer. The default namespace is created when the cluster is provisioned. It is namedroot.
Namespace APIs are part of the v2 APIs. The v2 APIs are available in
the dgo/v250 package today. Other SDKs are being updated currently.
Creating a new namespace
To create a namespace, use theCreateNamespace function.
SetSchema, RunDQL or similar functions.
Dropping a namespace
To drop a namespace, use theDropNamespace function.
Rename a namespace
To rename a namespace, use theRenameNamespace function.
List all namespaces
To list all namespaces, use theListNamespaces function.
v2 APIs
Version 25 introduces support for v2 APIs, including simpler client creation and DQL execution. The v2 APIs are available in thedgo/v250 package today. Other
clients are being updated currently.
Open a connection
The dgo package supports connecting to a Dgraph cluster using connection strings. Dgraph connection strings take the formdgraph://host:port?arguments
with support for the following arguments:
| Argument | Value | Description |
|---|---|---|
bearertoken | <token> | an access token |
sslmode | disable require verify-ca | TLS option, the default is disable. If verify-ca is set, the TLS certificate configured in the Dgraph cluster must be from a valid certificate authority. |
Open function with a connection string.
Advanced client creation
For more control, you can create a client using theNewClient function.
NewRoundRobinClient.
Connect to Hypermode Graph
You can use eitherOpen or NewClient to connect to a Hypermode Graph.
Hypermode automatically handles load balancing in multi-node clusters.
Using Open with a connection string:
NewClient:
Set schema
To set the schema, use theSetSchema function.
Run a mutation
To run a mutation, use theRunDQL function.
Run a query
To run a query, use the sameRunDQL function.
Run a query with variables
To run a query with variables, usingRunDQLWithVars.
Run a best effort query
To run aBestEffort query, use the same RunDQL function with TxnOption.
Run a read-only query
To run aReadOnly query, use the same RunDQL function with TxnOption.
Run a query with RDF response
To get the query response in RDF format instead of JSON format, use the followingTxnOption.
Run an upsert
TheRunDQL function also allows you to run upserts as well.
@if directive.
Drop all data
In order to drop all data in the cluster and start fresh, use theDropAllNamespaces function.
Model Context Protocol (MCP) Server
The Model Context Protocol (MCP) is a standard for making tools, data, and prompts available to AI models. It can be especially useful in bringing context on your stack into coding assistants. Version 25 of Dgraph introduces two MCP servers with common tools for AI coding assistants:mcpβ a server that provides tools and data from your Dgraph clustermcp-roβ a server that provides tools and data from your Dgraph cluster in read-only mode
Configuration
To add the MCP server to your coding assistant, add the following to your configuration file: When using Hypermode Graphs, the MCP configuration is available on the graph details screen in the console.Tools
The MCP servers provide the following tools:Get-Schemaβ fetch the schema of your clusterRun-Queryβ run a query on your clusterRun-Mutationβ run a mutation on your clusterAlter-Schemaβ modify the schema of your clusterGet-Common-Queriesβ provides reference queries to aide in query syntax