Skip to content

πŸ”Ž API Reference ​

Everything exported from the package root is public API.

ts
import {
  ApiPaginatedResponse,
  PageOptionsDTO,
  PaginatedDTO,
  QueryDTO,
  QueryService,
  parseQueryObject,
  serializeDecimalValues,
} from '@querry-kit/nest-prisma-query';

πŸ“€ Root Exports ​

ExportKindDescription
QueryServiceClassGeneric read/query service for Prisma-compatible delegates.
QueryServiceOptionsTypeOptional subject, access resolver, and error logger.
AccessibleWhereResolverTypeApp-provided resolver for access-control filters.
BaseDelegateTypeMinimal delegate method contract.
BaseDelegateTypeMapTypePrisma model type-map shape.
DelegateTypeMapTypeNormalized query option type-map.
QueryOptionsMapTypeDTO map consumed by QueryService.
FindOneDTODTOQuery DTO for findOne.
FindManyDTODTOQuery DTO for findMany.
FindByIdDTODTOQuery DTO for findById.
FindUniqueDTODTOQuery DTO for findUnique.
AggregateDTODTOQuery DTO for aggregate.
CountDTODTOQuery DTO for count.
QueryDTODTOPaginated resource query DTO.
PageOptionsDTODTOpage and perPage request options.
PageMetaDTODTOPagination metadata response DTO.
PaginatedDTODTOPaginated response DTO.
PaginatedTypeGeneric paginated result type.
ApiPaginatedResponseDecoratorSwagger response decorator for paginated DTOs.
parseQueryObjectFunctionWrapper around @querry-kit/nest-util/object parsing for Prisma query-service call sites.
serializeDecimalValuesFunctionPrisma-result wrapper around @querry-kit/nest-util/object Decimal-like value serialization.

🧭 Subpaths ​

ts
import { createCaslAccessibleWhere } from '@querry-kit/nest-prisma-query/casl';
import { QueryDTO } from '@querry-kit/nest-prisma-query/dto';
import { PageOptionsDTO } from '@querry-kit/nest-prisma-query/pagination';
import { QueryService } from '@querry-kit/nest-prisma-query/query-service';
import { ApiPaginatedResponse } from '@querry-kit/nest-prisma-query/swagger';
import { parseQueryObject } from '@querry-kit/nest-prisma-query/utils';

🧩 QueryService ​

QueryService exposes findOne, findMany, findById, findUnique, aggregate, count, and query.

The service parses query objects before forwarding them to the delegate. Parsing is delegated to @querry-kit/nest-util/object, so dotted keys become nested objects and string primitives become booleans, numbers, nulls, arrays, or objects where safe.

See QueryService for method examples and DTOs and Pagination for request/response DTOs.

πŸ” CASL ​

The ./casl subpath exports createCaslAccessibleWhere and CaslAccessibleWhereOptions.

See CASL for a relation-based access example.

Released under the MIT License.