Dgo mutate inserts all null values (id gets generated)

Ok, I’ve finally got it to work. Thanks.

For anyone else encountering the same issue - when you specify a GraphQL schema, a DQL schema is automatically generated.

The DQL mutation requires a JSON that is similar to the GraphQL schema, except it has “dgraph.type” (the value is the type of the entity) and every attribute requires the entity type to be prepended.

type Esop struct {
	Name            string `json:"name,omitempty"`
	Description     string `json:"description,omitempty"`
	Version         string `json:"version,omitempty"`
	ServiceEndpoint string `json:"service_endpoint,omitempty"`
	DgraphType      string `json:"dgraph.type,omitempty"`
}

type EsopDQL struct {
	Name            string `json:"Esop.name,omitempty"`
	Description     string `json:"Esop.description,omitempty"`
	Version         string `json:"Esop.version,omitempty"`
	ServiceEndpoint string `json:"Esop.service_endpoint,omitempty"`
	DgraphType      string `json:"dgraph.type,omitempty"`
}

Mapping my JSON from the top (Esop) to (EsopDQL) worked.

Thanks.