diff --git a/src/index.ts b/src/index.ts index 844ecaf5a2..fddd884198 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,6 +33,8 @@ export { graphql, graphqlSync } from './graphql'; /** Create and operate on GraphQL type definitions and schema. */ export { + resolveObjMapThunk, + resolveReadonlyArrayThunk, /** Definitions */ GraphQLSchema, GraphQLDirective, diff --git a/src/type/definition.ts b/src/type/definition.ts index ed658a8fc7..9a4fec2951 100644 --- a/src/type/definition.ts +++ b/src/type/definition.ts @@ -532,13 +532,13 @@ export function getNamedType( export type ThunkReadonlyArray = (() => ReadonlyArray) | ReadonlyArray; export type ThunkObjMap = (() => ObjMap) | ObjMap; -function resolveReadonlyArrayThunk( +export function resolveReadonlyArrayThunk( thunk: ThunkReadonlyArray, ): ReadonlyArray { return typeof thunk === 'function' ? thunk() : thunk; } -function resolveObjMapThunk(thunk: ThunkObjMap): ObjMap { +export function resolveObjMapThunk(thunk: ThunkObjMap): ObjMap { return typeof thunk === 'function' ? thunk() : thunk; } diff --git a/src/type/index.ts b/src/type/index.ts index 220412c4f0..72f24be4d6 100644 --- a/src/type/index.ts +++ b/src/type/index.ts @@ -11,6 +11,8 @@ export { export type { GraphQLSchemaConfig, GraphQLSchemaExtensions } from './schema'; export { + resolveObjMapThunk, + resolveReadonlyArrayThunk, /** Predicates */ isType, isScalarType,