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

> **resolveReturnPreference**(`prefer`, `url`): `"minimal"` | `"representation"` | `undefined`

Defined in: [response/prefer.ts:11](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/response/prefer.ts#L11)

The `return` preference to apply to a data modification request (OData-Protocol 4.01
§8.2.8.7): `'minimal'` (answer 204 No Content), `'representation'` (answer with the entity),
or `undefined` when the client expressed none.

`$select` or `$expand` on the request imply `return=representation` (§11.4.1.5), so a
`return=minimal` request carrying them gets `'representation'`.

Used by `ODataResponseInterceptor` and by the TypeORM adapter's `$batch` for its parts.

## Parameters

### prefer

`string` | readonly `string`\[] | `undefined`

### url

`string` | `undefined`

## Returns

`"minimal"` | `"representation"` | `undefined`
