Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

fix for nested filtering #372

Merged
merged 1 commit into from
Jan 7, 2020
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
6 changes: 5 additions & 1 deletion src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2778,7 +2778,11 @@ const buildRelatedTypeListComprehension = ({
if (rootIsRelationType) {
relationVariable = variableName;
}
const thisTypeVariable = safeVar(lowFirstLetter(thisType));

const thisTypeVariable =
!rootIsRelationType && !isRelationTypeNode
? safeVar(lowFirstLetter(variableName))
: safeVar(lowFirstLetter(thisType));
// prevents related node variable from
// conflicting with parent variables
const relatedTypeVariable = safeVar(`_${relatedType.toLowerCase()}`);
Expand Down
Loading