Luca
03/01/2019, 12:18 PMfunc (r *Resolver) Todo_userLoader(ctx context.Context, obj *Todo) (*User, error) {
return ctx.Value(userLoaderKey).(*UserLoader).Load(<http://obj.xxx|obj.xxx>) // I only have obj.ID and no obj.UserID or something similar
}
I can't seem to find a way to find a working solution. I could create a UserLoaderBySession and load them with session IDs: .(*UserLoader).Load(<http://obj.xxx|obj.xxx>)
, but when I provide todos belonging to the same user, my internal prisma where-or-query only returns unique results and since prisma doesn't return relation ids (like obj.UserID) I can't connect them to the session IDs afterwards (because dataloader expects 5 returned results when 5 ids are provided).
Any suggestions?