Not able to upload schema via admin url

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

Try enclosing your schema into in double quotes " --schema–". I was getting similar error when sending updateGQLSchema query to server from my client.

thank you :slight_smile: