Skip to content

Commit

Permalink
type/definition: export resolve*Thunk functions (#3426)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Dec 14, 2021
1 parent 4f56285 commit 95a85f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Expand Up @@ -33,6 +33,8 @@ export { graphql, graphqlSync } from './graphql';

/** Create and operate on GraphQL type definitions and schema. */
export {
resolveObjMapThunk,
resolveReadonlyArrayThunk,
/** Definitions */
GraphQLSchema,
GraphQLDirective,
Expand Down
4 changes: 2 additions & 2 deletions src/type/definition.ts
Expand Up @@ -532,13 +532,13 @@ export function getNamedType(
export type ThunkReadonlyArray<T> = (() => ReadonlyArray<T>) | ReadonlyArray<T>;
export type ThunkObjMap<T> = (() => ObjMap<T>) | ObjMap<T>;

function resolveReadonlyArrayThunk<T>(
export function resolveReadonlyArrayThunk<T>(
thunk: ThunkReadonlyArray<T>,
): ReadonlyArray<T> {
return typeof thunk === 'function' ? thunk() : thunk;
}

function resolveObjMapThunk<T>(thunk: ThunkObjMap<T>): ObjMap<T> {
export function resolveObjMapThunk<T>(thunk: ThunkObjMap<T>): ObjMap<T> {
return typeof thunk === 'function' ? thunk() : thunk;
}

Expand Down
2 changes: 2 additions & 0 deletions src/type/index.ts
Expand Up @@ -11,6 +11,8 @@ export {
export type { GraphQLSchemaConfig, GraphQLSchemaExtensions } from './schema';

export {
resolveObjMapThunk,
resolveReadonlyArrayThunk,
/** Predicates */
isType,
isScalarType,
Expand Down

0 comments on commit 95a85f7

Please sign in to comment.