dialect/sql/sqlgraph: fix bug in entql predicate evaluation (#1827)

This commit is contained in:
Ariel Mashraki
2021-08-11 21:03:52 +03:00
committed by GitHub
parent 30330751bb
commit e71ccc6b6e
3 changed files with 42 additions and 28 deletions

View File

@@ -88,4 +88,10 @@ func EntQL(t *testing.T, client *ent.Client) {
uq = client.User.Query()
uq.Filter().WhereRole(entql.StringEQ(string(user.RoleAdmin)))
require.Equal(a8m.ID, uq.OnlyIDX(ctx))
uq = client.User.Query()
uq.Filter().WhereName(entql.StringEQ(a8m.Name))
uq = uq.QueryFriends()
uq.Filter().WhereName(entql.StringEQ(nati.Name))
require.Equal(luna.ID, uq.QueryPets().OnlyIDX(ctx))
}