Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type/definition: export resolve*Thunk functions #3426

Merged
merged 1 commit into from Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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