Hi, I am trying to configure my schema without using the Dgraph Cloud UI. I’ve been looking for this solution in the documentation, but I can’t find it and I’m a bit stuck with this problem.
The thing is that I’ve found the solution but only when is Dgraph is self hosted. In this article, It sais that you can create a graphql file and set your schema inside, and then using this request curl -X POST localhost:8080/admin/schema --data-binary '@schema.graphql'
you can set it by http protocol but, when you are using cloud that endpoint does not exist. They gave you the following solution but, is there any way of combining this two? I do not have much experience using Dgraph and curl.
#!/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
Thank you.