inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

173만명의 커뮤니티!! 함께 토론해봐요.

NestJs, Apollo Federation 관련 질문 입니다.

미해결

Slack 클론 코딩[백엔드 with NestJS + TypeORM]

nestjs를 리용하여 microservice를 만들고 있는데 gateway를 통하여 하위앱들에 접근하고 있습니다. applications- app에서 정의한 스키마 schoolyear.entity.ts를 users-app, students-app등 다른 여러 app 들에서 사용하려고 합니다. //application-app @ObjectType() @Directive( '@key(fields: "school_year_id, date_begin, date_end")', ) @Entity({ name: 'mth_schoolyear' }) export class SchoolYear extends BaseEntity { @Column() @Field(() => ID, { nullable: true }) @PrimaryGeneratedColumn() school_year_id?: number; @Column() @Field(() => Date, { nullable: true }) date_begin: Date; @Column() @Field(() => Date, { nullable: true }) date_end: Date; } //users-app @ObjectType() @Directive('@extends') @Directive( '@key(fields: "school_year_id , date_begin, date_end")', ) @Entity({ name: 'mth_schoolyear' }) export class SchoolYear extends BaseEntity { @Column() @Field(() => ID, { nullable: true }) @PrimaryGeneratedColumn() @Directive('@external') school_year_id?: number; @Column() @Field(() => Date, { nullable: true }) @Directive('@external') date_begin: Date; @Column() @Field(() => Date, { nullable: true }) @Directive('@external') date_end: Date; } //students-app @ObjectType() @Directive('@extends') @Directive( '@key(fields: "school_year_id , date_begin, date_end")', ) @Entity({ name: 'mth_schoolyear' }) export class SchoolYear extends BaseEntity { @Column() @Field(() => ID, { nullable: true }) @PrimaryGeneratedColumn() @Directive('@external') school_year_id?: number; @Column() @Field(() => Date, { nullable: true }) @Directive('@external') date_begin: Date; @Column() @Field(() => Date, { nullable: true }) @Directive('@external') date_end: Date; } 1. @Directive(@key(fields)) 와 @Directive('@external') 사이에 어떤 관계가 있는지? @Directive('@external')가 정의된 모든 field를 @Directive(@key(fields))에 정의해야 합니까? 2. Users-app에서 정의한 external field "date_begin", "date_end"가 stuents-app에도 중복존재하는데 오유가 아닙니까?

  • apollo
  • federation
  • express
  • nodejs
  • nestjs
  • directive
  • NestJS
  • TypeORM
Cheng Wan 댓글 1 좋아요 0 조회수 433

인기 태그

인프런 TOP Writers

주간 인기글