Skip to content

Commit

Permalink
fix: update remaining GraphQLNonNull<GraphQLType> codepoints to (#3622
Browse files Browse the repository at this point in the history
)

`GraphQLNonNull<GraphQLNullableType>`

This is related to #3597, in the sense that #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:
#3617 (comment)
  • Loading branch information
yaacovCR authored Jun 6, 2022
1 parent 2fb6eca commit 1de3bd3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/type/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ export function isNonNullType(
return instanceOf(type, GraphQLNonNull);
}

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

export type GraphQLWrappingType =
| GraphQLList<GraphQLType>
| GraphQLNonNull<GraphQLType>;
| GraphQLNonNull<GraphQLNullableType>;

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

0 comments on commit 1de3bd3

Please sign in to comment.