Skip to content

Commit

Permalink
findBreakingChanges: Correctly document not reachable statement (#1896)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed May 22, 2019
1 parent 93a3bda commit ab93bf4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utilities/findBreakingChanges.js
Expand Up @@ -8,6 +8,7 @@
*/

import find from '../polyfills/find';
import inspect from '../jsutils/inspect';
import {
type GraphQLNamedType,
type GraphQLFieldMap,
Expand Down Expand Up @@ -292,7 +293,10 @@ function typeKindName(type: GraphQLNamedType): string {
if (isInputObjectType(type)) {
return 'an Input type';
}
throw new TypeError('Unknown type ' + type.constructor.name);

// Not reachable. All possible named types have been considered.
/* istanbul ignore next */
throw new TypeError(`Unexpected type: ${inspect((type: empty))}.`);
}

function findFieldsThatChangedTypeOnObjectOrInterfaceTypes(
Expand Down

0 comments on commit ab93bf4

Please sign in to comment.