Skip to content

Commit

Permalink
modified resolver to return specific result type
Browse files Browse the repository at this point in the history
  • Loading branch information
atGit2021 committed Nov 20, 2024
1 parent 55140d4 commit 06e463a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Parent, ResolveField, Resolver } from '@nestjs/graphql';
import { Loader, LoaderOf } from '@seedcompany/data-loader';
import { LanguageEngagement } from '../../engagement/dto';
import { PnpExtractionResult } from './extraction-result.dto';
import { PnpPlanningExtractionResult } from './extraction-result.dto';
import { PnpExtractionResultLoader } from './pnp-extraction-result.loader';

@Resolver(LanguageEngagement)
export class PnpExtractionResultLanguageEngagementConnectionResolver {
@ResolveField(() => PnpExtractionResult, {
@ResolveField(() => PnpPlanningExtractionResult, {
nullable: true,
})
async pnpExtractionResult(
@Parent() engagement: LanguageEngagement,
@Loader(() => PnpExtractionResultLoader)
loader: LoaderOf<PnpExtractionResultLoader>,
): Promise<PnpExtractionResult | null> {
): Promise<PnpPlanningExtractionResult | null> {
const fileId = engagement.pnp.value;
if (!fileId) {
return null;
Expand Down

0 comments on commit 06e463a

Please sign in to comment.