You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A modifier or relation listed twice in a relation expression, like withGraphFetched('pets(onlyDogs, onlyDogs)') or '[pets, pets]', is applied once. It was applied twice: the modifier's where clause was repeated, and the relation was loaded with two identical queries, unless the expression was merged with one of 10 or more modifiers or relations. In that case it was applied once: union(), which merges them, kept the duplicates of its first array only when both arrays were shorter than 10 items. It now always returns the unique values of both, like lodash's union(), and string expressions go through the same normalization as object ones. Inherited from objection.js.
Docs
The validation guide explains that insertGraph() and upsertGraph() validate each model without its relation properties, while insert() and patch() validate with them. This changes in 5.0.
The custom query builder recipe uses a static get QueryBuilder() getter, and links to the TypeScript notes on builders in their own files, WithGraphQueryBuilder and select().