Skip to content

Commit ab5a471

Browse files
committed
fix: update remaining GraphQLNonNull<GraphQLType> codepoints to
`GraphQLNonNull<GraphQLNullableType>` This is related to graphql#3597, in the sense that graphql#3597 made the `GraphQLNonNull<GraphQL*Type>` => `GraphQLNonNull<GraphQLNullable*Type>` change in other code points related to the `isNonNullType` function, but not within `GraphQLWrappingType` or assertNonNullType. This PR was prompted by the uncovering of a bug by a different PR, see: graphql#3617 (comment)
1 parent 540bb38 commit ab5a471

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/type/definition.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,9 @@ export function isNonNullType(
183183
return instanceOf(type, GraphQLNonNull);
184184
}
185185

186-
export function assertNonNullType(type: unknown): GraphQLNonNull<GraphQLType> {
186+
export function assertNonNullType(
187+
type: unknown,
188+
): GraphQLNonNull<GraphQLNullableType> {
187189
if (!isNonNullType(type)) {
188190
throw new Error(`Expected ${inspect(type)} to be a GraphQL Non-Null type.`);
189191
}
@@ -395,7 +397,7 @@ export class GraphQLNonNull<T extends GraphQLNullableType> {
395397

396398
export type GraphQLWrappingType =
397399
| GraphQLList<GraphQLType>
398-
| GraphQLNonNull<GraphQLType>;
400+
| GraphQLNonNull<GraphQLNullableType>;
399401

400402
export function isWrappingType(type: unknown): type is GraphQLWrappingType {
401403
return isListType(type) || isNonNullType(type);

0 commit comments

Comments
 (0)