inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

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

e2e 테스트(강좌 마무리)

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

427

Cheng Wan

작성한 질문수 5

0

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

답변 1

0

제로초(조현영)

제가 graphql을 안 해서 @Directive가 무슨 역할인지 잘 모르겠습니다.

강의자료는 어디서 다운받나요?

0

110

3

질문 있습니다.

0

294

3

(강의 5:42 질문) providers를 통한 여러 개의 인스턴스 생성 & exports 통한 싱글톤 생성

0

154

2

코드 편집기 확장 프로그램

0

209

2

(질문)비밀 저장소에 접근하기 위한 인증 정보는 로컬 .env에 저장하는지?

0

143

2

(질문)외부 저장소를 통한 환경변수 불러오기 비동기 질문

0

166

3

로그인을 해도 LoggedInGuard쪽에서 false값이 나옵니다.

0

152

2

로그인방법이 고민됩니다.

0

190

2

yarn seed 명령어 실행 시 데이터 삽입 안됨

0

296

4

yarn run db:create 시에 발생하는 데코레이터 오류

0

242

2

npm run db:create 시에 발생하는 decorating 오류

0

231

2

RxJS 디버깅 질문 있습니다.

0

187

3

CacheManager에 대해 질문 있습니다.

0

173

2

로깅은 어떻게 하는게 효율적일까요?

0

224

1

CORS 질문 있습니다.

0

417

2

쿠키 옵션에 대해서 질문 있습니다.

0

184

2

로그아웃 요청이 403 forbidden 에러가 나는데 왜그런걸까요??

0

447

1

401 unauthorized문제

0

285

1

가드의 장점에 대해서 질문이 있습니다.

0

225

1

로그 관리에 대해 질문 있습니다.

0

252

2

CORS 에러 질문 있습니다.

0

318

2

배포 환경 DB 연결 질문 있습니다.

0

411

2

socket io 미 연결 문제 (nest & flutter)

1

1153

3

no elements in sequence 에러 관해서 질문이 있습니다.

0

454

1