Get Started
- Dgraph Cloud Overview
- Provision a backend
- Authentication
- Anonymous Access
- Fetching and Updating Your Schema
- Switch Dgraph Cloud Schema Modes
- Advanced Queries with DQL
- Monitoring with Prometheus
- Dropping Data from your Backend
- Cloning Backend
- Multi-tenancy in Dgraph Cloud
- Importing and Exporting data from Dgraph Cloud
Cloud API
Schema
Get Schema
Fetch the schema from your backend.
Cloud Endpoint
Copy
https://${DEPLOYMENT_URL}/admin
API Command
Copy
{
getGQLSchema {
schema
generatedSchema
}
}
Example
Copy
#!/usr/bin/env bash
DEPLOYMENT_URL="polished-violet.us-east-1.aws.cloud.dgraph.io"
DEPLOYMENT_JWT="<deployment-jwt>"
curl "https://${DEPLOYMENT_URL}/admin" \
-H "Content-Type: application/json" \
-H "X-Auth-Token: ${DEPLOYMENT_JWT}" \
--data-binary '{"query":"{\n getGQLSchema {\n schema\n generatedSchema\n }\n}","variables":{}}' \
--compressed
Update Schema
Update the schema in your backend.
Cloud Endpoint
Copy
https://${DEPLOYMENT_URL}/admin
API Command
Copy
mutation ($schema: String!) {
updateGQLSchema(input: { set: { schema: $schema } }) {
gqlSchema {
schema
}
}
}
Arguments
schema
: your desired schema string in GraphQL format
Example
Copy
#!/usr/bin/env bash
DEPLOYMENT_URL="polished-violet.us-east-1.aws.cloud.dgraph.io"
DEPLOYMENT_JWT="<deployment-jwt>"
curl "https://${DEPLOYMENT_URL}/admin" \
-H "Content-Type: application/json" \
-H "X-Auth-Token: ${DEPLOYMENT_JWT}" \
--data-binary '{"query":"mutation($sch: String!) {\n updateGQLSchema(input: { set: { schema: $sch } })\n {\n gqlSchema {\n schema\n }\n }\n}","variables":{"sch": "type Person { name: String! }"}}' \
--compressed
Assistant
Responses are generated using AI and may contain mistakes.