# query.getInclude() function · @imqueue/pg-sequelize

Source: https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.query.getinclude/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-sequelize 4.2.0 — generated reference, not hand-written

Finds the include options for a model reached through a chain of includes.

**Signature:**

```typescript
export function getInclude(queryOptions: FindOptions, path: (typeof Model)[]): IncludeOptions | null;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| queryOptions | FindOptions | Query to search. |
| path | (typeof Model)\[\] | Models to follow, outermost first. |


**Returns:**

IncludeOptions \| null

The matching include options, or `null` when the path does not resolve.

## Remarks

The way to reach into a query that is already built — to add a where clause to a join, say, without rebuilding the whole thing. The path is walked one model at a time, and it is CONSUMED as that happens, so pass a copy if the caller still needs it.

