Skip to content

Commit 0b0b075

Browse files
committed
fix: change the if statement
1 parent 99af55c commit 0b0b075

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/appsync-modelgen-plugin/src/visitors/appsync-visitor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,10 @@ export class AppSyncModelVisitor<
726726
Object.values(this.modelMap).forEach(model => {
727727
model.fields.forEach(field => {
728728
const connectionInfo = field.connectionInfo;
729-
if (connectionInfo?.kind === CodeGenConnectionType.BELONGS_TO && connectionInfo.targetName !== 'id') {
729+
if (connectionInfo
730+
&& connectionInfo.kind !== CodeGenConnectionType.HAS_MANY
731+
&& connectionInfo.kind !== CodeGenConnectionType.HAS_ONE
732+
&& connectionInfo.targetName !== 'id') {
730733
// Need to remove the field that is targetName
731734
removeFieldFromModel(model, connectionInfo.targetName);
732735
}

0 commit comments

Comments
 (0)