Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion src/utilities/__tests__/findBreakingChanges-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,36 @@ describe('findBreakingChanges', () => {
}
});

const interface1 = new GraphQLInterfaceType({
name: 'Interface1',
fields: {
field1: { type: GraphQLString },
},
resolveType: () => null,
});

const typeThatLosesInterfaceOld = new GraphQLObjectType({
name: 'TypeThatGainsInterface1',
interfaces: [
interface1
],
fields: {
field1: {
type: GraphQLString,
},
},
});

const typeThaLosesInterfaceNew = new GraphQLObjectType({
name: 'TypeThatGainsInterface1',
interfaces: [],
fields: {
field1: {
type: GraphQLString,
},
},
});

const oldSchema = new GraphQLSchema({
query: queryType,
types: [
Expand All @@ -1221,7 +1251,8 @@ describe('findBreakingChanges', () => {
typeThatHasBreakingFieldChangesOld,
unionTypeThatLosesATypeOld,
enumTypeThatLosesAValueOld,
argThatChanges
argThatChanges,
typeThatLosesInterfaceOld
]
});

Expand All @@ -1233,6 +1264,8 @@ describe('findBreakingChanges', () => {
unionTypeThatLosesATypeNew,
enumTypeThatLosesAValueNew,
argChanged,
typeThaLosesInterfaceNew,
interface1
]
});

Expand Down Expand Up @@ -1278,6 +1311,11 @@ describe('findBreakingChanges', () => {
description: 'ArgThatChanges.field1 arg id has changed ' +
'type from Int to String',
},
{
type: BreakingChangeType.INTERFACE_REMOVED_FROM_OBJECT,
description: 'TypeThatGainsInterface1 no longer implements ' +
'interface Interface1.',
}
];
expect(findBreakingChanges(oldSchema, newSchema)).to.eql(
expectedBreakingChanges
Expand Down