fixed oneOf case queryer issue with resolving the table alias
This commit is contained in:
@ -461,10 +461,24 @@ impl<'a> Compiler<'a> {
|
||||
.cloned()
|
||||
.unwrap_or_else(|| format!("{}_t_err", node.parent_alias));
|
||||
|
||||
let mut lookup_key = prop_key.as_str();
|
||||
|
||||
if let Some(edges) = node.schema.obj.compiled_edges.get() {
|
||||
if let Some(edge) = edges.get(prop_key) {
|
||||
if let Some(relation) = self.db.relations.get(&edge.constraint) {
|
||||
if edge.forward {
|
||||
lookup_key = &relation.source_columns[0];
|
||||
} else {
|
||||
lookup_key = &relation.destination_columns[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(gf) = grouped_fields {
|
||||
for (t_name, fields_val) in gf {
|
||||
if let Some(fields_arr) = fields_val.as_array() {
|
||||
if fields_arr.iter().any(|v| v.as_str() == Some(prop_key)) {
|
||||
if fields_arr.iter().any(|v| v.as_str() == Some(lookup_key)) {
|
||||
owner_alias = table_aliases
|
||||
.get(t_name)
|
||||
.cloned()
|
||||
|
||||
Reference in New Issue
Block a user