Skip to content

Commit 95a85f7

Browse files
type/definition: export resolve*Thunk functions (#3426)
1 parent 4f56285 commit 95a85f7

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export { graphql, graphqlSync } from './graphql';
3333

3434
/** Create and operate on GraphQL type definitions and schema. */
3535
export {
36+
resolveObjMapThunk,
37+
resolveReadonlyArrayThunk,
3638
/** Definitions */
3739
GraphQLSchema,
3840
GraphQLDirective,

src/type/definition.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,13 @@ export function getNamedType(
532532
export type ThunkReadonlyArray<T> = (() => ReadonlyArray<T>) | ReadonlyArray<T>;
533533
export type ThunkObjMap<T> = (() => ObjMap<T>) | ObjMap<T>;
534534

535-
function resolveReadonlyArrayThunk<T>(
535+
export function resolveReadonlyArrayThunk<T>(
536536
thunk: ThunkReadonlyArray<T>,
537537
): ReadonlyArray<T> {
538538
return typeof thunk === 'function' ? thunk() : thunk;
539539
}
540540

541-
function resolveObjMapThunk<T>(thunk: ThunkObjMap<T>): ObjMap<T> {
541+
export function resolveObjMapThunk<T>(thunk: ThunkObjMap<T>): ObjMap<T> {
542542
return typeof thunk === 'function' ? thunk() : thunk;
543543
}
544544

src/type/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export {
1111
export type { GraphQLSchemaConfig, GraphQLSchemaExtensions } from './schema';
1212

1313
export {
14+
resolveObjMapThunk,
15+
resolveReadonlyArrayThunk,
1416
/** Predicates */
1517
isType,
1618
isScalarType,

0 commit comments

Comments
 (0)