I’m trying to insert data into Dgraph using Dgo - when I mutate, all the values that are supposed to get inserted are null:
{
"data": {
"queryEsop": [
{
"id": "0x4e28",
"name": null,
"type": null,
"version": null,
"description": null,
"service_endpoint": null
}
]
}
}
The Go struct:
type TestInput struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Type string `json:"type,omitempty"`
Version string `json:"version,omitempty"`
ServiceEndpoint string `json:"service_endpoint,omitempty"`
DgraphType string `json:"dgraph.type,omitempty"`
}
The marshalled Json byte array, printed as a string shows:
"{\"name\":\"The Name\",\"description\":\"The Description\",\"type\":\"The Type\",\"version\":\"The Version\",\"service_endpoint\":\"The Endpoint\",\"dgraph.type\":\"Esop\"}"
The schema
type Esop {
id: ID!
name: String @search(by: [regexp])
type: String
version: String
description: String
service_endpoint: String
hasWorkflows: LeaveApplication @hasInverse(field: isWorkflowOf)
}
I’m using the latest Dgo packages with the latest version of Dgraph Docker images (for zero and alpha)
"github.com/dgraph-io/dgo/v210"
"github.com/dgraph-io/dgo/v210/protos/api"