Refactored query result getter handlers to support recursivity (#8497)
The `QueryResultGettersFactory` that is called on every query return to was called only on the first level of relations because recursivity wasn't implemented. In this PR I implement recursivity and add some typing for the possible forms a GraphQL query field can take. This PR will fix any issue we have with pictures that were losing their token (here for person.avatarUrl) Fixes https://github.com/twentyhq/twenty/issues/8425 Fixes https://github.com/twentyhq/twenty/issues/8498 --------- Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
import { Logger } from '@nestjs/common';
|
||||
|
||||
import { isDefined } from 'class-validator';
|
||||
|
||||
/**
|
||||
* A decorator function that logs the execution time of the decorated method.
|
||||
*
|
||||
* @returns The modified property descriptor with the execution time logging functionality.
|
||||
*/
|
||||
export function LogExecutionTime() {
|
||||
export function LogExecutionTime(label?: string | undefined) {
|
||||
return function (
|
||||
target: any,
|
||||
propertyKey: string,
|
||||
@ -21,7 +23,11 @@ export function LogExecutionTime() {
|
||||
const end = performance.now();
|
||||
const executionTime = end - start;
|
||||
|
||||
logger.log(`Execution time: ${executionTime.toFixed(2)}ms`);
|
||||
if (isDefined(label)) {
|
||||
logger.log(`${label} execution time: ${executionTime.toFixed(2)}ms`);
|
||||
} else {
|
||||
logger.log(`Execution time: ${executionTime.toFixed(2)}ms`);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user