Fix message channel processing (#12021)

Several users have complained about not being able to read their emails
anymore.

This is because the find-messages post query hook is expecting
ObjectRecord[] as an input but is actually getting a graphql Connection

Typing was wrong. This PR fixes the typing and make sure the post query
hook always get an ObjectRecord[]
This commit is contained in:
Charles Bochet
2025-05-13 21:16:23 +02:00
committed by GitHub
parent c0a0214879
commit 0202586d36
48 changed files with 217 additions and 129 deletions

View File

@ -24,4 +24,5 @@ export enum GraphqlQueryRunnerExceptionCode {
RELATION_TARGET_OBJECT_METADATA_NOT_FOUND = 'RELATION_TARGET_OBJECT_METADATA_NOT_FOUND',
NOT_IMPLEMENTED = 'NOT_IMPLEMENTED',
OBJECT_METADATA_COLLECTION_NOT_FOUND = 'OBJECT_METADATA_COLLECTION_NOT_FOUND',
INVALID_POST_HOOK_PAYLOAD = 'INVALID_POST_HOOK_PAYLOAD',
}

View File

@ -171,20 +171,14 @@ export abstract class GraphqlQueryBaseResolverService<
options.objectMetadataMaps,
);
const resultWithGettersArray = Array.isArray(resultWithGetters)
? resultWithGetters
: [resultWithGetters];
await this.workspaceQueryHookService.executePostQueryHooks(
authContext,
objectMetadataItemWithFieldMaps.nameSingular,
operationName,
resultWithGettersArray,
resultWithGetters,
);
return Array.isArray(resultWithGetters)
? resultWithGettersArray
: resultWithGettersArray[0];
return resultWithGetters;
} catch (error) {
workspaceQueryRunnerGraphqlApiExceptionHandler(error, options);
}