Skip to content

Commit

Permalink
fix(impliedRelations): 🐛 A fallback field already is the opp field
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Jan 21, 2022
1 parent 675c0f3 commit a584da5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/graphUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ export function getFieldInfo(userHiers: UserHier[], field: string) {
}

export function getOppFields(userHiers: UserHier[], field: string) {
// If the field ends with `>`, it is already the opposite field we need (coming from getOppFallback`)
if (field.endsWith(">")) return field.slice(0, -4);
const { fieldHier, fieldDir } = getFieldInfo(userHiers, field);
const oppDir = getOppDir(fieldDir);
return fieldHier[oppDir];
Expand Down

0 comments on commit a584da5

Please sign in to comment.