From ab5a47137531ddb8451e75f68ce170af48f211e3 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Tue, 31 May 2022 15:31:43 +0300 Subject: [PATCH] fix: update remaining `GraphQLNonNull` codepoints to `GraphQLNonNull` This is related to #3597, in the sense that #3597 made the `GraphQLNonNull` => `GraphQLNonNull` 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: https://github.com/graphql/graphql-js/pull/3617#discussion_r885544662 --- src/type/definition.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/type/definition.ts b/src/type/definition.ts index 9eea02e8ea..2f9f837cd8 100644 --- a/src/type/definition.ts +++ b/src/type/definition.ts @@ -183,7 +183,9 @@ export function isNonNullType( return instanceOf(type, GraphQLNonNull); } -export function assertNonNullType(type: unknown): GraphQLNonNull { +export function assertNonNullType( + type: unknown, +): GraphQLNonNull { if (!isNonNullType(type)) { throw new Error(`Expected ${inspect(type)} to be a GraphQL Non-Null type.`); } @@ -395,7 +397,7 @@ export class GraphQLNonNull { export type GraphQLWrappingType = | GraphQLList - | GraphQLNonNull; + | GraphQLNonNull; export function isWrappingType(type: unknown): type is GraphQLWrappingType { return isListType(type) || isNonNullType(type);