Hi there,
I am currently building a webapp with Golang and dgraph. My problem is the following:
My starting point from all queries is the logged in user. From the user I get his company which has again groups/teams. Out of the complete list of these groups which belong to the company, I want to filter for the uids which are provided in the POST request. However when I use the method QueryWithVars, the UIDs which are inserted as a comma separated string are not recognized correctly. I think this is because they are being interpreted as one uid instead of several ones. But I am not sure, if I am doing something wrong here or if this is actually a bug.
Here is my code:
variables := database.QueryVariables{
"$id": userID,
"$idOwners": strings.Join(objectiveInput.IDGroups, ","), // objectiveInput.IDGroups is of type []string
}
query := `query Owner($id: string, $idOwners: string){
var(func: uid($id)) {
company as user_company {
}
}
groups(func: uid($idOwners)) {
group_company @filter(uid(company))
uid
groupName
}
}`
response, err := a.dgraph.NewTxn().QueryWithVars(ctx, query, variables)
Any help would be highly appreciated!
Thanks
Sebastian