diff --git a/apis/api-journeys/src/app/modules/journey/journey.resolver.ts b/apis/api-journeys/src/app/modules/journey/journey.resolver.ts index fc4382ce222..15c2cd12176 100644 --- a/apis/api-journeys/src/app/modules/journey/journey.resolver.ts +++ b/apis/api-journeys/src/app/modules/journey/journey.resolver.ts @@ -1272,4 +1272,24 @@ export class JourneyResolver { where: { journeyId: journey.id } }) } + + @ResolveField('journeyCustomizationDescription') + async journeyCustomizationDescription( + @Parent() journey: Journey + ): Promise { + if (journey.journeyCustomizationDescription !== undefined) { + return journey.journeyCustomizationDescription + } + + const journeyWithCustomizationDescription = + await this.prismaService.journey.findFirst({ + where: { id: journey.id, deletedAt: null }, + select: { journeyCustomizationDescription: true } + }) + + return ( + journeyWithCustomizationDescription?.journeyCustomizationDescription ?? + null + ) + } }