File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
packages/appsync-modelgen-plugin/src/visitors Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -701,10 +701,6 @@ export class AppSyncModelVisitor<
701701 isList : false ,
702702 isNullable : field . isNullable ,
703703 } ) ;
704- } else if ( connectionInfo . targetName !== 'id' ) {
705- // TODO: Remove this branch when we can roll forward.
706- // Need to remove the field that is targetName, only apply if shouldRevertBreakingKeyChange is set
707- removeFieldFromModel ( model , connectionInfo . targetName ) ;
708704 }
709705 field . connectionInfo = connectionInfo ;
710706 }
@@ -726,6 +722,16 @@ export class AppSyncModelVisitor<
726722 return true ;
727723 } ) ;
728724 } ) ;
725+
726+ Object . values ( this . modelMap ) . forEach ( model => {
727+ model . fields . forEach ( field => {
728+ const connectionInfo = field . connectionInfo ;
729+ if ( connectionInfo ?. kind === CodeGenConnectionType . BELONGS_TO && connectionInfo . targetName !== 'id' ) {
730+ // Need to remove the field that is targetName
731+ removeFieldFromModel ( model , connectionInfo . targetName ) ;
732+ }
733+ } ) ;
734+ } )
729735 }
730736
731737 protected processV2KeyDirectives ( ) : void {
You can’t perform that action at this time.
0 commit comments