Like this?
I’m not sure if you can do this query bellow via HTTP API. Pls, let me know if it doesn’t.
{
"query": "{ v as var(func:type(Company) ) { p as projects }",
"set": {
"uid": "uid(v)",
"new_projects": [{ "uid": "uid(p)"}]
},
"delete": {
"uid": "uid(v)",
"projects": [{ "uid": "uid(p)"}] #This deletes the relations only
},
"delete": {
"uid": "uid(p)" # This will clean the projects
}
}