@@ -1214,6 +1214,36 @@ describe('findBreakingChanges', () => {
1214
1214
}
1215
1215
} ) ;
1216
1216
1217
+ const interface1 = new GraphQLInterfaceType ( {
1218
+ name : 'Interface1' ,
1219
+ fields : {
1220
+ field1 : { type : GraphQLString } ,
1221
+ } ,
1222
+ resolveType : ( ) => null ,
1223
+ } ) ;
1224
+
1225
+ const typeThatLosesInterfaceOld = new GraphQLObjectType ( {
1226
+ name : 'TypeThatGainsInterface1' ,
1227
+ interfaces : [
1228
+ interface1
1229
+ ] ,
1230
+ fields : {
1231
+ field1 : {
1232
+ type : GraphQLString ,
1233
+ } ,
1234
+ } ,
1235
+ } ) ;
1236
+
1237
+ const typeThaLosesInterfaceNew = new GraphQLObjectType ( {
1238
+ name : 'TypeThatGainsInterface1' ,
1239
+ interfaces : [ ] ,
1240
+ fields : {
1241
+ field1 : {
1242
+ type : GraphQLString ,
1243
+ } ,
1244
+ } ,
1245
+ } ) ;
1246
+
1217
1247
const oldSchema = new GraphQLSchema ( {
1218
1248
query : queryType ,
1219
1249
types : [
@@ -1222,7 +1252,8 @@ describe('findBreakingChanges', () => {
1222
1252
typeThatHasBreakingFieldChangesOld ,
1223
1253
unionTypeThatLosesATypeOld ,
1224
1254
enumTypeThatLosesAValueOld ,
1225
- argThatChanges
1255
+ argThatChanges ,
1256
+ typeThatLosesInterfaceOld
1226
1257
]
1227
1258
} ) ;
1228
1259
@@ -1234,6 +1265,8 @@ describe('findBreakingChanges', () => {
1234
1265
unionTypeThatLosesATypeNew ,
1235
1266
enumTypeThatLosesAValueNew ,
1236
1267
argChanged ,
1268
+ typeThaLosesInterfaceNew ,
1269
+ interface1
1237
1270
]
1238
1271
} ) ;
1239
1272
@@ -1279,6 +1312,11 @@ describe('findBreakingChanges', () => {
1279
1312
description : 'ArgThatChanges.field1 arg id has changed ' +
1280
1313
'type from Int to String' ,
1281
1314
} ,
1315
+ {
1316
+ type : BreakingChangeType . INTERFACE_REMOVED_FROM_OBJECT ,
1317
+ description : 'TypeThatGainsInterface1 no longer implements ' +
1318
+ 'interface Interface1.' ,
1319
+ }
1282
1320
] ;
1283
1321
expect ( findBreakingChanges ( oldSchema , newSchema ) ) . to . eql (
1284
1322
expectedBreakingChanges
0 commit comments