diff --git a/types/graphql-relay/index.d.ts b/types/graphql-relay/index.d.ts index 50ed0c3b7d..fc1eb3aa1e 100644 --- a/types/graphql-relay/index.d.ts +++ b/types/graphql-relay/index.d.ts @@ -21,6 +21,9 @@ import { GraphQLOutputType, GraphQLFieldResolver, GraphQLTypeResolver, + GraphQLUnionType, + GraphQLEnumType, + GraphQLScalarType, Thunk } from "graphql"; @@ -58,9 +61,20 @@ export const backwardConnectionArgs: GraphQLFieldConfigArgumentMap & { */ export const connectionArgs: GraphQLFieldConfigArgumentMap & ForwardConnectionArgs & BackwardConnectionArgs; +export type ConnectionConfigNodeTypeNullable = + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType; + +export type ConnectionConfigNodeType = + | ConnectionConfigNodeTypeNullable + | GraphQLNonNull; + export interface ConnectionConfig { name?: string | null; - nodeType: GraphQLObjectType; + nodeType: ConnectionConfigNodeType; resolveNode?: GraphQLFieldResolver | null; resolveCursor?: GraphQLFieldResolver | null; edgeFields?: Thunk> | null;