Skip to content

Commit

Permalink
feat(core): Backward compatibility and ability to use old logic to wo…
Browse files Browse the repository at this point in the history
…rk around bugs in collections
  • Loading branch information
monrostar committed Mar 1, 2024
1 parent ddaaaf2 commit e9762ed
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ export type ExtendedListQueryOptions<T extends VendureEntity> = {
* @default false
*/
ignoreQueryLimits?: boolean;

/**
@description
* Specifies how relations must be loaded - using "joins" or separate queries.
* If you are loading too much data with nested joins it's better to load relations
* using separate queries.
*
* Default strategy is "join", but default can be customized in connection options.
* @since 2.2.0
* @default 'query'
*/
relationLoadStrategy?: 'join' | 'query';
};

/**
Expand Down Expand Up @@ -282,7 +294,7 @@ export class ListQueryBuilder implements OnApplicationBootstrap {
take,
skip,
where: extendedOptions.where || {},
relationLoadStrategy: 'query',
relationLoadStrategy: extendedOptions?.relationLoadStrategy || 'query',
});

// join the tables required by calculated columns
Expand Down

0 comments on commit e9762ed

Please sign in to comment.