@@ -3044,6 +3044,111 @@ class EditOperationAnalyzerTest extends Specification {
30443044 userModification. details. isEmpty()
30453045 }
30463046
3047+ def " deleted field with fixed parent binding can map to isolated node" () {
3048+ given :
3049+ def oldSdl = '''
3050+ type Query {
3051+ notifications: NotificationQuery
3052+ }
3053+ type NotificationQuery {
3054+ notificationFeed(
3055+ feedFilter: NotificationFeedFilter
3056+ first: Int = 25
3057+ after: String
3058+ ): NotificationGroupedConnection!
3059+ unseenNotificationCount(workspaceId: String, product: String): Int!
3060+ }
3061+ input NotificationFeedFilter {
3062+ workspaceId: String
3063+ productFilter: String
3064+ groupId: String
3065+ }
3066+ type NotificationItem {
3067+ notificationId: ID!
3068+ workspaceId: String
3069+ }
3070+ type NotificationGroupedItem {
3071+ groupId: ID!
3072+ groupSize: Int!
3073+ headNotification: NotificationItem!
3074+ childItems(first: Int, after: String): [NotificationItem!]
3075+ }
3076+ type NotificationGroupedConnection {
3077+ nodes: [NotificationGroupedItem!]!
3078+ }
3079+ '''
3080+ def newSdl = '''
3081+ type Query {
3082+ notifications: NotificationQuery
3083+ }
3084+ type NotificationQuery {
3085+ notificationFeed(
3086+ filter: NotificationFilter
3087+ first: Int = 25
3088+ after: String
3089+ ): NotificationFeedConnection!
3090+ notificationGroup(
3091+ groupId: String!
3092+ filter: NotificationFilter
3093+ first: Int = 25
3094+ after: String
3095+ ): NotificationGroupConnection!
3096+ unseenNotificationCount(workspaceId: String, product: String): Int!
3097+ }
3098+ input NotificationFilter {
3099+ workspaceId: String
3100+ productFilter: String
3101+ }
3102+ type NotificationEntityModel{
3103+ objectId: String!
3104+ containerId: String
3105+ workspaceId: String
3106+ cloudId: String
3107+ }
3108+ type NotificationItem {
3109+ notificationId: ID!
3110+ entityModel: NotificationEntityModel
3111+ workspaceId: String
3112+ }
3113+ type NotificationHeadItem {
3114+ groupId: ID!
3115+ groupSize: Int!
3116+ readStates: [String]!
3117+ additionalTypes: [String!]!
3118+ headNotification: NotificationItem!
3119+ endCursor: String
3120+ }
3121+ type NotificationFeedConnection {
3122+ nodes: [NotificationHeadItem!]!
3123+ }
3124+ type NotificationGroupConnection {
3125+ nodes: [NotificationItem!]!
3126+ }
3127+ '''
3128+
3129+ when :
3130+ def changes = calcDiff(oldSdl, newSdl)
3131+
3132+ then :
3133+ changes[" NotificationGroupedItem" ] === changes[" NotificationHeadItem" ]
3134+ changes[" NotificationGroupedConnection" ] === changes[" NotificationFeedConnection" ]
3135+ changes[" NotificationGroupedItem" ] instanceof ObjectModification
3136+ changes[" NotificationGroupedConnection" ] instanceof ObjectModification
3137+ changes[" NotificationEntityModel" ] instanceof ObjectAddition
3138+ changes[" NotificationGroupConnection" ] instanceof ObjectAddition
3139+ changes[" NotificationItem" ] instanceof ObjectModification
3140+ changes[" NotificationQuery" ] instanceof ObjectModification
3141+
3142+ changes[" NotificationFeedFilter" ] === changes[" NotificationFilter" ]
3143+ changes[" NotificationFeedFilter" ] instanceof InputObjectModification
3144+
3145+ def notificationFeedFilterChange = changes[" NotificationFeedFilter" ] as InputObjectModification
3146+ notificationFeedFilterChange. details. size() == 1
3147+ notificationFeedFilterChange. details[0 ] instanceof InputObjectFieldDeletion
3148+ def groupIdInputObjectFieldDeletion = notificationFeedFilterChange. details[0 ] as InputObjectFieldDeletion
3149+ groupIdInputObjectFieldDeletion. name == " groupId"
3150+ }
3151+
30473152 EditOperationAnalysisResult calcDiff (
30483153 String oldSdl ,
30493154 String newSdl
0 commit comments