Get Schema
Fetch the schema from your backend.
Cloud Endpoint
API Command
Example
#!/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
API Command
Arguments
schema
: your desired schema string in GraphQL format
Example
#!/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