diff --git a/src/composeWithPagination.ts b/src/composeWithPagination.ts index 54abe02..73a8dce 100644 --- a/src/composeWithPagination.ts +++ b/src/composeWithPagination.ts @@ -1,13 +1,16 @@ import { ObjectTypeComposer } from 'graphql-compose'; import { preparePaginationResolver, - ComposeWithPaginationOpts, + PaginationResolverOpts, DEFAULT_RESOLVER_NAME, } from './pagination'; +/** + * @deprecated use `preparePaginationResolver()` instead + */ export function composeWithPagination( typeComposer: ObjectTypeComposer, - opts: ComposeWithPaginationOpts + opts: PaginationResolverOpts ): ObjectTypeComposer { if (!typeComposer || typeComposer.constructor.name !== 'ObjectTypeComposer') { throw new Error( diff --git a/src/index.ts b/src/index.ts index 31a9c7e..b0d3ff8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import { composeWithPagination } from './composeWithPagination'; export { composeWithPagination, preparePaginationResolver }; export type { - ComposeWithPaginationOpts, + PaginationResolverOpts, PaginationTArgs, PaginationType, PaginationInfoType, diff --git a/src/pagination.ts b/src/pagination.ts index 8f98216..f10edc3 100644 --- a/src/pagination.ts +++ b/src/pagination.ts @@ -9,7 +9,7 @@ import { preparePaginationTC } from './types'; export const DEFAULT_RESOLVER_NAME = 'pagination'; export const DEFAULT_PER_PAGE = 20; -export type ComposeWithPaginationOpts = { +export type PaginationResolverOpts = { findManyResolver: Resolver; countResolver: Resolver; name?: string; @@ -40,7 +40,7 @@ export interface PaginationTArgs { export function preparePaginationResolver( tc: ObjectTypeComposer, - opts: ComposeWithPaginationOpts + opts: PaginationResolverOpts ): Resolver { if (!tc || tc.constructor.name !== 'ObjectTypeComposer') { throw new Error(