Dgraph Cloud’s schema modes let you configure whether and
how schema changes are allowed. To alter your schema using the
/alter
HTTP
and gRPC endpoints, you’ll need to use Flexible Mode.Authentication
The APIs documented here all require an API token for access. To learn how to create an API token, please see Authentication.HTTP
You can query your backend with DQL using your cluster’s/query
endpoint. As
an example, if your GraphQL endpoint is
https://frozen-mango.us-west-2.aws.cloud.dgraph.io/graphql
, then the admin
endpoint for the schema is
https://frozen-mango.us-west-2.aws.cloud.dgraph.io/query
.
You can also access the /mutate
and /commit
endpoints.
For example, let’s say you have the following GraphQL schema:
/mutate
endpoint:
/query
endpoint:
gRPC
Dgraph Cloud is compatible with most existing Dgraph clients. You can use the helper methods from each library to connect to your backend, passing in a Dgraph Cloud endpoint and an API token. Here is an example which uses the pydgraph client to make gRPC requests.pydgraph
client:
pydgraph
client:
Connecting from Dgraph clients
Below are snippets to connect to your Dgraph Cloud backend from various Dgraph clients.Python
JavaScript
Go
Java
.NET
Visualizing your Graph with Ratel
You can use Ratel to visualize your Dgraph Cloud backend with DQL. You can host Ratel yourself, or you can use Ratel online at Dgraph Play. To configure Ratel:- Click the Dgraph logo in the top left to bring up the connection screen (by default, it has the caption: play.dgraph.io)
- Enter your host in the Dgraph Server URL field. This is obtained by removing
/graphql
from the end of your/graphql
endpoint URL. For example, if your/graphql
endpoint ishttps://frozen-mango.us-west-2.aws.cloud.dgraph.io/graphql
, then the host for Ratel ishttps://frozen-mango.us-west-2.aws.cloud.dgraph.io
- Click the Connect button. You should see a green check mark next to the word Connected.
- Click on the Extra Settings tab, and then enter your API token into the API Key field. To create a new API token, see Authentication.
- Click on the Continue button.