Skip to main content

Overview

The @ParsedRequest decorator is a parameter decorator that injects the parsed CRUD request object into your controller method parameters. It provides access to parsed query parameters, filters, joins, pagination settings, and more.

Signature

Returns

CrudRequest
The parsed CRUD request object
ParsedRequestParams
Parsed request parameters including:
  • fields - Selected fields
  • paramsFilter - URL parameter filters
  • search - Search conditions
  • filter - Query filters
  • or - OR conditions
  • join - Relation joins
  • sort - Sort configuration
  • limit - Pagination limit
  • offset - Pagination offset
  • page - Current page number
  • cache - Cache settings
CrudRequestOptions
Request options including query, routes, and params configuration

Usage

Basic Usage

Accessing Query Parameters

Using with URL Parameters

Inspecting Joins

Modifying Request Before Processing

Using in Create/Update Operations

Complete Integration Test Example

From the source tests:
packages/crud/test/crud.decorator.override.spec.ts:48-56

Standalone Usage with Interceptor

Implementation Details

packages/crud/src/decorators/parsed-request.decorator.ts:6-10
The decorator is built using NestJS’s createParamDecorator and extracts the parsed request from the execution context.
The @ParsedRequest decorator automatically works with routes generated by @Crud. For custom routes, use @UseInterceptors(CrudRequestInterceptor) to enable request parsing.
The parsed request object is read-only in most scenarios. While you can modify it in your code, changes may not affect the underlying query execution depending on when the service method is called.

Request Structure

Typical parsed request structure:

See Also