---
url: /nestjs-odata/api/generated/functions/ODataQueryParam.md
---
# Function: ODataQueryParam()

> **ODataQueryParam**(`entitySetName?`): `ParameterDecorator`

Defined in: [decorators/odata-query.decorator.ts:34](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/decorators/odata-query.decorator.ts#L34)

Parameter decorator that extracts req.query and auto-applies ODataQueryPipe.

Usage:
@Get()
async getProducts(@ODataQueryParam('Products') query: ODataQuery) { ... }

The decorator passes the entitySetName as `data` so that the ODataQueryPipe
can inject it into the query object for context URL construction and field validation.

Per D-04: auto-applies ODataQueryPipe — no @UsePipes(ODataQueryPipe) needed.
Per D-05: ODataQueryPipe remains exported for advanced use cases.
Per D-06: eliminates silent validation bypass when forgetting @UsePipes.

NestJS resolves ODataQueryPipe from DI automatically when a class reference
is passed as the pipe argument to a createParamDecorator result.

Zero TypeORM imports — per PKG-01 architecture constraint.

## Parameters

### entitySetName?

`string`

## Returns

`ParameterDecorator`
