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

> **getODataBatchPart**(`request?`): [`ODataBatchPartContext`](../interfaces/ODataBatchPartContext.md) | `undefined`

Defined in: [batch/batch-dispatch.ts:62](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/batch/batch-dispatch.ts#L62)

The `$batch` operation being handled, or `undefined` for a request that is not part of a
`$batch`. Guards, interceptors, route handlers and hooks can read it to apply a batch-specific
policy (for example refusing some operations inside a batch).

Read from `request` when given (pass it from guards and middleware, which run before the
OData request context is set), else from the request of the current OData request context,
else from the async context.

## Parameters

### request?

`unknown`

## Returns

[`ODataBatchPartContext`](../interfaces/ODataBatchPartContext.md) | `undefined`
