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

> **dispatchBatchOperation**(`adapter`, `operation`, `part?`): `Promise`<[`BatchOperationResponse`](../interfaces/BatchOperationResponse.md)>

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

Run one operation through the application's HTTP stack, in process: the Fastify instance's
`inject()`, else the Express application (a Node request handler). When `part` is given, the
operation runs as that `$batch` operation: in its async context and, on Express, with `part`
attached to the request (see [getODataBatchPart](getODataBatchPart.md)). Fastify's `inject()` cannot carry
request properties: there the async context is the only carrier.

## Parameters

### adapter

[`BatchHttpAdapter`](../interfaces/BatchHttpAdapter.md)

### operation

[`BatchOperationRequest`](../interfaces/BatchOperationRequest.md)

### part?

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

## Returns

`Promise`<[`BatchOperationResponse`](../interfaces/BatchOperationResponse.md)>
