Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions apps/server/app/x-pick.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,16 @@ func (w *fileWork) xPick() {
w.P(" ps = append(ps, ", eq, "(k.Get", name.Go(), "()))")
}
case graph.Edge:
// The Pick is the target's, since it is the target that is
// being found. The getter and the predicate are the edge's:
// the reference message names its field after the edge, and
// so does ent. The two only agree when the edge is named after
// what it points at.
name_target := work.Name(p_.Target().Name())
w.P(" if p, err := ", name_target, "Pick(k.Get", name_target.Go(), "()); err != nil {")
w.P(" if p, err := ", name_target, "Pick(k.Get", name.Go(), "()); err != nil {")
w.P(" return nil, ", work.PkgGrpcStatus.Ident("Errorf"), "(", work.PkgGrpcCodes.Ident("InvalidArgument"), ", \"", name_p, ".", name, ": %s\", ", "err)")
w.P(" } else {")
w.P(" ps = append(ps, ", x.Ident("Has"+name_target.Go()+"With"), "(p))")
w.P(" ps = append(ps, ", x.Ident("Has"+name.Go()+"With"), "(p))")
w.P(" }")
default:
panic("unknown type of graph prop")
Expand Down
36 changes: 36 additions & 0 deletions internal/apptest/ent/seat.g.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions internal/apptest/query.g.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions internal/apptest/schema/seat.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading