diff --git a/src/type/definition.ts b/src/type/definition.ts index 5b62ba7739..9eea02e8ea 100644 --- a/src/type/definition.ts +++ b/src/type/definition.ts @@ -51,22 +51,9 @@ import type { GraphQLSchema } from './schema'; * These are all of the possible kinds of types. */ export type GraphQLType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType + | GraphQLNamedType | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - >; + | GraphQLNonNull; export function isType(type: unknown): type is GraphQLType { return ( @@ -207,9 +194,7 @@ export function assertNonNullType(type: unknown): GraphQLNonNull { * These types may be used as input types for arguments and directives. */ export type GraphQLNullableInputType = - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType + | GraphQLNamedInputType | GraphQLList; export type GraphQLInputType = @@ -236,11 +221,7 @@ export function assertInputType(type: unknown): GraphQLInputType { * These types may be used as output types as the result of fields. */ export type GraphQLNullableOutputType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType + | GraphQLNamedOutputType | GraphQLList; export type GraphQLOutputType = @@ -430,14 +411,7 @@ export function assertWrappingType(type: unknown): GraphQLWrappingType { /** * These types can all accept null as a value. */ -export type GraphQLNullableType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList; +export type GraphQLNullableType = GraphQLNamedType | GraphQLList; export function isNullableType(type: unknown): type is GraphQLNullableType { return isType(type) && !isNonNullType(type);