File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/appsync-modelgen-plugin/src/visitors Expand file tree Collapse file tree 1 file changed +13
-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,19 @@ 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
730+ && connectionInfo . kind !== CodeGenConnectionType . HAS_MANY
731+ && connectionInfo . kind !== CodeGenConnectionType . HAS_ONE
732+ && connectionInfo . targetName !== 'id' ) {
733+ // Need to remove the field that is targetName
734+ removeFieldFromModel ( model , connectionInfo . targetName ) ;
735+ }
736+ } ) ;
737+ } )
729738 }
730739
731740 protected processV2KeyDirectives ( ) : void {
You can’t perform that action at this time.
0 commit comments