Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findBreakingChanges: Correctly document not reachable statement #1896

Merged
merged 1 commit into from May 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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