objection breaking changes
Updated December 4, 2026
On this page
Latest version 4.4.6, released November 29, 2026. Source repository
Its 4.0.0 release requires Node.js 20.19 or later. Node.js end of life dates.
- From 3.9.2 to 4.3.0: 231 breaking changes in 4 versions.
- From 3.1.3 to 4.3.0: 352 breaking changes in 15 versions.
objection 4.3.0 breaking changes
- Signature changed
InsertGraphMethod.__call
Was <QB extends AnyQueryBuilder>(this: QB, graph: PartialModelGraph<M>, options?: InsertGraphOptions): SingleQueryBuilder<QB> <QB extends AnyQueryBuilder>(this: QB, graph: PartialModelGraph<M>[], options?: InsertGraphOptions)... npmjs.com - Signature changed
UpsertGraphMethod.__call
Was <QB extends AnyQueryBuilder>(this: QB, graph: PartialModelGraph<M>, options?: UpsertGraphOptions): SingleQueryBuilder<QB> <QB extends AnyQueryBuilder>(this: QB, graph: PartialModelGraph<M>[], options?: UpsertGraphOptions)... npmjs.com
objection 4.2.0 breaking changes
- Behavior changed
patchAndFetch
Running the same patchAndFetch() or updateAndFetch() query a second time now throws instead of re-running. Code that awaits the same query object twice must build a new query for each run. github.com - Behavior changed
updateAndFetch
Running the same updateAndFetch() or patchAndFetch() query a second time now throws instead of re-running. Code that awaits the same query object twice must build a new query for each run. github.com
objection 4.1.0 breaking changes
- Behavior changed
On PostgreSQL, JSON field expressions with a single key now generate -> and ->> instead of #> and #>>. Expression indexes built on the #>> form must be rebuilt with ->>. github.com - Signature changed
WhereMethod.__call
Was <QBP extends QB>(obj: IfStrict<PartialModelProps<ModelType<QBP>>, never>): QB; now <QBP extends QB, const O extends object = {}>(obj: IfStrict<PartialModelProps<ModelType<QBP>>, O & WhereColumns<ModelType<QBP>, O>>): QB. npmjs.com
objection 4.0.0 breaking changes
- Removed
Objection 4.0 needs at least Node.js 20.19. ditojs.github.io - Removed
CountChar
CountChar was removed in objection 4.0.0 npmjs.com - Removed
default
Replace the default import with a namespace import that contains the same values. npmjs.com - Removed
InsertableGraphField
InsertableGraphField was removed in objection 4.0.0 npmjs.com - Removed
InsertableGraphReference
InsertableGraphReference was removed in objection 4.0.0 npmjs.com - Removed
InsertablePropertyNames
InsertablePropertyNames was removed in objection 4.0.0 npmjs.com - Removed
InsertGraphOptions.allowMarkers
Remove allowMarkers from insertGraph() calls in TypeScript code. npmjs.com - Removed
IsBalanced
IsBalanced was removed in objection 4.0.0 npmjs.com - Removed
ItemType
ItemType was removed in objection 4.0.0 npmjs.com - Removed
objection.lib
Only objection and objection/package.json can be imported now. ditojs.github.io
And 215 more in this version. Sign up to see every change
objection 3.9.2 breaking changes
- Behavior changed
upsertGraph
upsertGraph skips the update and $beforeUpdate() hooks for models whose given props are unchanged, ignoring props that are not written to the database. Code relying on hooks running in that case may need to change. github.com
objection 3.9.0 breaking changes
- Behavior changed
When SQL Server reports several errors for one statement, objection throws a DBError with all messages instead of the driver's AggregateError, which is kept as nativeError. github.com - Behavior changed
Graph expressions like children.[pets, ^] are now rejected instead of silently never matching. github.com - Behavior changed
deleteById
deleteById(1).where(a).orWhere(b) now runs id = 1 and (a or b), so code relying on the old precedence may delete different rows. github.com - Behavior changed
insertGraph
Related models of models skipped by noInsert are no longer inserted unless a #ref points to them. github.com - Behavior changed
patch
A many-to-many patch that only changes join table extras now returns the number of related rows updated instead of 0, and afterUpdate hooks receive that number. github.com - Behavior changed
patchById
patchById now groups its id condition separately from user where clauses, so the precedence of or-clauses changes. github.com - Behavior changed
pickJsonSchemaProperties
Field expression keys like meta:a are now kept, so patch, update and upsertGraph write them. Keys found only on Object.prototype are no longer picked. github.com - Behavior changed
update
A many-to-many update that only changes join table extras now returns the number of related rows updated instead of 0. github.com - Behavior changed
updateById
updateById now groups its id condition separately from user where clauses, so the precedence of or-clauses changes. github.com - Behavior changed
upsertGraph
When upsertGraph replaces a BelongsToOne row, the owner now points to the new row before the old one is deleted. A new row repeating a unique value of the old row now fails, so pass the old row's id to update it instead. github.com
And 2 more in this version. Sign up to see every change
Older versions
10 older versions, each with its first changes. Sign up to see every change
Show 10 older versions
objection 3.8.0 breaking changes
- Behavior changed
Warnings now start with '[objection] ' and each is logged once; code matching warning text may need updating. github.com - Behavior changed
Constraint, not-null and data errors are DBError subclasses; read err.nativeError.number instead of err.number. github.com
And 12 more in this version.
objection 3.7.0 breaking changes
- Removed
knexIdentifierMapping
The mapNestedKeys option that 3.5.0 added to knexIdentifierMapping() is removed, and results are again converted one level deep. github.com - Removed
KnexIdentifierMappingOptions
The KnexIdentifierMappingOptions type is removed from the typings. npmjs.com
And 14 more in this version.
objection 3.6.0 breaking changes
- Behavior changed
$clone
The internal deep copy now keeps null-prototype objects as they are and copies nested Buffers and BigInt64Array/BigUint64Array instead of sharing them with the original. github.com - Behavior changed
insertGraph
Inserting models of these relations where the join table is also the related table now throws an error. Code that relied on the old behavior must change. github.com
And 13 more in this version.
objection 3.5.0 breaking changes
- Signature changed
KnexIdentifierMappingFactory.__call
Was (colToProp: Record<string, string>): KnexMappers; now (colToProp: Record<string, string>, options?: KnexIdentifierMappingOptions): KnexMappers. npmjs.com - Signature changed
Model.BelongsToOneRelation
Was static BelongsToOneRelation: RelationType; now static BelongsToOneRelation: BelongsToOneRelationType. npmjs.com
And 10 more in this version.
objection 3.4.0 breaking changes
- Behavior changed
unrelate
On many-to-many and has-one-through relations whose join table is also the related table, unrelate() now throws an error instead of modifying the wrong rows. github.com - Behavior changed
upsertGraph
upsertGraph no longer treats JSON arrays and objects as unchanged when they loosely equal the current value, such as false and []. Such values are now written. github.com
And 2 more in this version.
objection 3.3.0 breaking changes
- Behavior changed
Patch objects with field expression keys such as 'meta:a.b' are validated against the nested schema, so patches that passed before can now fail validation. github.com - Behavior changed
asFindQuery
Inside hooks, asFindQuery() no longer applies the runAfter() callbacks of the original query, including throwIfNotFound() and traverse(). A findById() that finds nothing now returns [] instead of [undefined]. github.com
And 17 more in this version.
objection 3.2.0 breaking changes
- Behavior changed
for
Calling for() outside relatedQuery() now throws instead of being silently ignored. Remove such calls, since Model.query().for(1).delete() previously deleted every row. github.com - Behavior changed
withGraphJoined
The last of withGraphJoined() or withGraphFetched() no longer decides the algorithm for all relations. A top-level relation can now only be loaded with one of them, so review queries that load the same relation both ways. github.com
And 21 more in this version.
objection 3.1.5 breaking changes
- Signature changed
Model.relatedQuery
Was static relatedQuery<M extends Model, K extends keyof M>(this: Constructor<M>, relationName: K, trxOrKnex?: TransactionOrKnex): ArrayRelatedQueryBuilder<M[K]>; now static relatedQuery<M extends Model, K extends keyof M>(this... npmjs.com - Signature changed
Model.transaction
Was static transaction<T>(trxOrKnex: TransactionOrKnex, callback: (trx: Transaction) => Promise<T>): Promise<T>; now static transaction<T>(trxOrKnex: TransactionOrKnex | undefined, callback: (trx: Transaction) => Promise<T>): Promise<T>. npmjs.com
And 1 more in this version.
objection 3.1.4 breaking changes
- Removed
Model.$omit
Model.$omit was removed in objection 3.1.4 npmjs.com - Removed
Model.$pick
Model.$pick was removed in objection 3.1.4 npmjs.com
objection 3.1.3 breaking changes
- Signature changed
Constructor
Was type Constructor<TResult, TParams extends any[] = any[]> = new (...params: TParams) => TResult; now interface Constructor<T>. npmjs.com
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.