@@ -73,8 +73,7 @@ export type GraphQLType =
7373 | GraphQLInterfaceType
7474 | GraphQLUnionType
7575 | GraphQLEnumType
76- | GraphQLInputObjectType
77- | GraphQLList < GraphQLType >
76+ | GraphQLList < GraphQLOutputType >
7877 > ;
7978
8079export function isType ( type : unknown ) : type is GraphQLType {
@@ -213,24 +212,15 @@ export function assertNonNullType(type: unknown): GraphQLNonNull<GraphQLType> {
213212 return type ;
214213}
215214
216- export function isSemanticNonNullType (
217- type : GraphQLInputType ,
218- ) : type is GraphQLSemanticNonNull < GraphQLInputType > ;
219- export function isSemanticNonNullType (
220- type : GraphQLOutputType ,
221- ) : type is GraphQLSemanticNonNull < GraphQLOutputType > ;
222- export function isSemanticNonNullType (
223- type : unknown ,
224- ) : type is GraphQLSemanticNonNull < GraphQLType > ;
225215export function isSemanticNonNullType (
226216 type : unknown ,
227- ) : type is GraphQLSemanticNonNull < GraphQLType > {
217+ ) : type is GraphQLSemanticNonNull < GraphQLNullableType & GraphQLOutputType > {
228218 return instanceOf ( type , GraphQLSemanticNonNull ) ;
229219}
230220
231221export function assertSemanticNonNullType (
232222 type : unknown ,
233- ) : GraphQLSemanticNonNull < GraphQLType > {
223+ ) : GraphQLSemanticNonNull < GraphQLNullableType & GraphQLOutputType > {
234224 if ( ! isSemanticNonNullType ( type ) ) {
235225 throw new Error (
236226 `Expected ${ inspect ( type ) } to be a GraphQL Semantic-Non-Null type.` ,
@@ -485,7 +475,9 @@ export class GraphQLNonNull<T extends GraphQLNullableType> {
485475 *
486476 * @experimental
487477 */
488- export class GraphQLSemanticNonNull < T extends GraphQLNullableType > {
478+ export class GraphQLSemanticNonNull <
479+ T extends GraphQLNullableType & GraphQLOutputType ,
480+ > {
489481 readonly ofType : T ;
490482
491483 constructor ( ofType : T ) {
@@ -516,8 +508,8 @@ export class GraphQLSemanticNonNull<T extends GraphQLNullableType> {
516508
517509export type GraphQLWrappingType =
518510 | GraphQLList < GraphQLType >
519- | GraphQLNonNull < GraphQLType >
520- | GraphQLSemanticNonNull < GraphQLType > ;
511+ | GraphQLNonNull < GraphQLNullableType >
512+ | GraphQLSemanticNonNull < GraphQLNullableType & GraphQLOutputType > ;
521513
522514export function isWrappingType ( type : unknown ) : type is GraphQLWrappingType {
523515 return isListType ( type ) || isNonNullType ( type ) || isSemanticNonNullType ( type ) ;
@@ -555,7 +547,10 @@ export function assertNullableType(type: unknown): GraphQLNullableType {
555547
556548export function getNullableType ( type : undefined | null ) : void ;
557549export function getNullableType < T extends GraphQLNullableType > (
558- type : T | GraphQLNonNull < T > | GraphQLSemanticNonNull < T > ,
550+ type :
551+ | T
552+ | GraphQLNonNull < T >
553+ | GraphQLSemanticNonNull < T extends GraphQLOutputType ? T : never > ,
559554) : T ;
560555export function getNullableType (
561556 type : Maybe < GraphQLType > ,
0 commit comments