entc/gen: fix eager-loading for m2m edges (#335)

Fixed #334
This commit is contained in:
Ariel Mashraki
2020-02-08 22:26:30 +02:00
committed by GitHub
parent c8940e6a5f
commit 48d33fde9d
15 changed files with 19 additions and 19 deletions

View File

@@ -355,7 +355,7 @@ func (gq *GroupQuery) sqlAll(ctx context.Context) ([]*Group, error) {
return fmt.Errorf("unexpected id value for edge-in")
}
outValue := int(eout.Int64)
inValue := int(eout.Int64)
inValue := int(ein.Int64)
node, ok := ids[outValue]
if !ok {
return fmt.Errorf("unexpected node id in edges: %v", outValue)

View File

@@ -409,7 +409,7 @@ func (uq *UserQuery) sqlAll(ctx context.Context) ([]*User, error) {
return fmt.Errorf("unexpected id value for edge-in")
}
outValue := int(eout.Int64)
inValue := int(eout.Int64)
inValue := int(ein.Int64)
node, ok := ids[outValue]
if !ok {
return fmt.Errorf("unexpected node id in edges: %v", outValue)