Your mutation is missing an important field: dgraph.type.
For example: I made this change -
type user struct {
Email string `json:"User.email"`
Password string `json:"User.pass"`
Name string `json:"User.name"`
Status string `json:"User.status"`
DgraphType string `json:"dgraph.type"`
}
and
user := user{
Email: email,
Password: password,
Name: name,
Status: "Active",
DgraphType: "User",
}
such that the mutation actually reads like this:
2020/12/02 08:38:20 mutation: {"User.email":"XXX@yyy.con","User.pass":"penisisnotashortpassword","User.name":"Isocol","User.status":"Active","dgraph.type":"User"}
And when I query, I get this result:
{
"data": {
"queryUser": [
{
"email": "XXX@yyy.con",
"name": "Isocol",
"workPlace": null,
"status": "Active",
"description": null
}
]
},
"extensions": {
"touched_uids": 6,
"tracing": {
"version": 1,
"startTime": "2020-12-01T21:40:48.926844065Z",
"endTime": "2020-12-01T21:40:48.928158281Z",
"duration": 1314239,
"execution": {
"resolvers": [
{
"path": [
"queryUser"
],
"parentType": "Query",
"fieldName": "queryUser",
"returnType": "[User]",
"startOffset": 92806,
"duration": 1193696,
"dgraph": [
{
"label": "query",
"startOffset": 144826,
"duration": 1105511
}
]
}
]
}
},
"queryCost": 1
}
}