Hi There,
Any chance to get the code below to work without new structs or modifying existing proto definitions ?
I’m currently getting the error “json: cannot unmarshal array into Go struct field Root.data of type pb.Root”
// unmarshaling query result
tmp := pb.Root{}
err := json.Unmarshal(resp.Json, &tmp)
Here are the query / proto definitions :
// query
// {
// data(func: eq(name, "my name")){
// name
// field1
// field2
// }
// }
// pb definition
// message MyStruct {
// string name = 1;
// string field1 = 2;
// string field2 = 3;
// }
// message Root {
// MyStruct data = 1;
// }
Thanks !