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:
@ -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',
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user