Future<void> uploadSchema() async {
final url = "https://myurl.aws.cloud.dgraph.io/admin";
final resp = await http.post(Uri.parse(url),
headers: {
"Dg-Auth": "$learn_admin_key",
"Content-Type": "application/json"
},
body: jsonEncode({
"query": """
mutation {
updateGQLSchema(
input: { set: { schema: 'type Person { name: String }'}})
{
gqlSchema {
schema
generatedSchema
}
}
}
"""
}));
print("Resp ${resp.body} ${resp.statusCode}");
}
Got response :
Resp {"errors":[{"message":"Query not supported"}]} 200