Limit rest api relations depth to 1 (#14453)

Until we tackle [Implement relations depth 2 for rest
api](https://github.com/twentyhq/twenty/issues/14452), let's remove the
depth 2 query parameter which is not working (times out all the time).
This commit is contained in:
Marie
2025-09-12 17:57:16 +02:00
committed by GitHub
parent 12a5ee6bc4
commit 89254ea9e9
11 changed files with 18 additions and 109 deletions
@@ -1,7 +1,7 @@
import { computeDepth } from 'src/engine/api/rest/core/query-builder/utils/compute-depth.utils';
describe('computeDepth', () => {
[0, 1, 2].forEach((depth) => {
[0, 1].forEach((depth) => {
it('should compute depth from query', () => {
const request: any = {
query: { depth: `${depth}` },
@@ -2,7 +2,7 @@ import { BadRequestException } from '@nestjs/common';
import { type Request } from 'express';
const ALLOWED_DEPTH_VALUES = [0, 1, 2];
const ALLOWED_DEPTH_VALUES = [0, 1];
export const computeDepth = (request: Request): number | undefined => {
if (!request.query.depth) {
@@ -6,7 +6,7 @@ export const MAX_DEPTH = 2;
export type Depth = 0 | 1 | 2;
const ALLOWED_DEPTH_VALUES: Depth[] = [0, 1, MAX_DEPTH];
const ALLOWED_DEPTH_VALUES: Depth[] = [0, 1];
@Injectable()
export class DepthInputFactory {