# BaseModel.appendChild() method · @imqueue/pg-sequelize

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

Attaches related data to this instance as though it had been joined in.

**Signature:**

```typescript
appendChild(name: string, data: any): this;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| name | string | Property to set, normally an association name. |
| data | any | What to attach: an instance, an array of them, or anything else. |


**Returns:**

this

This instance, for chaining.

## Remarks

Sets the property, and when a `returning` list is in force adds the name to it so the property survives serialization. That is the point of it: data fetched by a second query would otherwise be dropped by `toJSON()`.

