Skip to content

Comments

[Feature/#157] - graphiql 적용 및 루트 질문 선택을 위한 관련 엔티티, resolver 추가#162

Merged
alsgud8311 merged 7 commits intodevelopmentfrom
feature/#157
Sep 19, 2025
Merged

[Feature/#157] - graphiql 적용 및 루트 질문 선택을 위한 관련 엔티티, resolver 추가#162
alsgud8311 merged 7 commits intodevelopmentfrom
feature/#157

Conversation

@alsgud8311
Copy link
Contributor

📌 개요

graphiql 적용 및 루트 질문을 선택하기 위한 테이블의 root_question, category 에 대한 엔티티와 리졸버, 비즈니스 계층을 위한 서비스 계층까지 추가하였습니다.

✅ 작업 내용

  • category 엔티티, 리졸버, 서비스 계층 추가
  • root_question 엔티티, 리졸버, 서비스 계층 추가
  • 개발 환경을 위한 서버 인프라 파일 생성(미완성)

🧪 테스트

  • 직접 테스트 완료

📝 참고 사항

graphiql의 경우, 별도의 의존성이 필요하지 않고 @nestjs/graphql 라이브러리에 포함되어 있어 playground가 아닌 graphiql 설정을 줌으로써 추가할 수 있었습니다.
기존 playground의 경우 유지보수가 이루어지지 않아 버그가 많아 graphiql로 변경하였습니다.

📎 관련 이슈

Closes #157

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @alsgud8311, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 GraphQL 개발 환경을 개선하고 면접 질문 관리 시스템의 기반을 마련합니다. GraphiQL을 도입하여 GraphQL API의 사용 편의성을 높였으며, 질문 카테고리와 루트 질문을 위한 새로운 엔티티, 리졸버, 서비스 계층을 추가하여 질문 데이터를 체계적으로 관리할 수 있는 토대를 구축했습니다. 또한, 개발 환경을 위한 Docker Compose 설정 파일을 추가하여 서버 배포 및 관리를 간소화했습니다.

Highlights

  • GraphiQL 개발 도구 적용: GraphQL API 테스트 및 탐색을 위한 GraphiQL 인터페이스를 통합했습니다. 기존 Playground의 유지보수 문제로 인해 GraphiQL로 변경되었습니다.
  • 질문 카테고리 관리 기능 추가: 루트 질문 선택을 위한 'Category' 엔티티, 리졸버, 서비스 계층을 새로 추가하여 질문 카테고리를 정의하고 조회할 수 있도록 했습니다.
  • 루트 질문 관리 기능 추가: 'RootQuestion' 엔티티, 리졸버, 서비스 계층을 추가하여 면접 질문의 기반이 되는 루트 질문을 관리하고 카테고리별로 조회할 수 있도록 했습니다.
  • 개발 환경 인프라 설정: 'compose.dev.yml' 및 'nginx.conf' 파일을 추가하여 개발 환경에서 NestJS 서버와 Nginx를 Docker Compose로 쉽게 배포하고 관리할 수 있도록 했습니다.
  • iOS 앱 설정 업데이트: 'Info.plist' 파일에서 앱 버전, 사진 라이브러리 접근 권한 설명, 상태 바 스타일을 업데이트했습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

🛠️ Build Summary

Status: ✅ SUCCESS
Duration: 55초
Exit Code: 0
Commit: 5407ab0

📋 Build Output (마지막 45줄)

   Generating static pages (1/4) 
   Generating static pages (2/4) 
   Generating static pages (3/4) 
 ✓ Generating static pages (4/4)
   Finalizing page optimization ...
   Collecting build traces ...

Route (pages)                                 Size  First Load JS
┌ ƒ /                                      79.7 kB         638 kB
├   /_app                                      0 B         308 kB
├ ○ /404 (1351 ms)                         1.78 kB         312 kB
├ ○ /500 (1350 ms)                           757 B         308 kB
├ ƒ /api/auth/logout                           0 B         308 kB
├ ƒ /dashboard                             15.2 kB         634 kB
├ ƒ /interviews                            7.87 kB         346 kB
├ ƒ /interviews/[interviewId]              11.6 kB         604 kB
├ ƒ /interviews/[interviewId]/result       5.46 kB         363 kB
├ ○ /layout (1350 ms)                        541 B         308 kB
├   └ css/2af4d3721e97fa9b.css               280 B
├ ƒ /login                                 2.12 kB         312 kB
├ ƒ /login/callback                        1.99 kB         333 kB
├ ƒ /login/profile                         11.3 kB         365 kB
├ ƒ /members/[memberId]                    4.16 kB         338 kB
├ ƒ /members/interviews/[interviewId]      6.83 kB         338 kB
├ ƒ /purchase                              8.82 kB         626 kB
├ ƒ /purchase/confirm                      1.76 kB         333 kB
├ ○ /purchase/error (1349 ms)                804 B         311 kB
├ ƒ /terms/privacy                         5.06 kB         336 kB
└ ƒ /terms/termsofuse                      4.47 kB         336 kB
+ First Load JS shared by all               323 kB
  ├ chunks/framework-962931b100bb889b.js   57.6 kB
  ├ chunks/main-2b7e191be8a937cb.js         176 kB
  ├ chunks/pages/_app-c8b8b22867d04788.js  72.4 kB
  ├ css/7b8ee3cf629bbb78.css               15.1 kB
  └ other shared chunks (total)            1.89 kB

ƒ Middleware                               96.7 kB

○  (Static)   prerendered as static content
ƒ  (Dynamic)  server-rendered on demand

   Memory usage report:
    - Total time spent in GC: 330.96ms
    - Peak heap usage: 67.99 MB
    - Peak RSS usage: 690.48 MB

🤖 Generated by GitHub Actions at Fri Sep 19 08:08:51 UTC 2025

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 PR은 GraphiQL을 도입하고, 루트 질문 선택을 위한 카테고리 및 루트 질문 관련 기능을 추가하는 내용이네요. 전반적으로 기능 추가와 개발 환경 개선이 잘 이루어진 것 같습니다. 몇 가지 개선점과 버그 수정이 필요한 부분을 아래 코멘트로 남겼습니다. 특히 category.ts 파일의 getCategories 메소드에 있는 로직 오류는 기능 동작에 치명적인 영향을 줄 수 있으니 꼭 확인해주세요.

Comment on lines 169 to 180
console.log(Object.values(CategoryType));
return Object.values(CategoryType)
.filter((type) => typeof type === "number")
.map((type: CategoryType) => {
const data = CATEGORY_DATA[type];
return new Category(
type,
data.title,
data.description,
BASE_URL + data.imageUrl
);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

이 메소드에 두 가지 문제가 있습니다.

  1. 디버깅용 console.log: 169번째 줄의 console.log는 디버깅용 코드로 보이며, 프로덕션 코드에 포함되지 않도록 제거해야 합니다.
  2. 치명적인 필터링 오류: 171번째 줄의 .filter((type) => typeof type === "number") 로직에 오류가 있습니다. CategoryType은 문자열 enum이므로 이 필터는 항상 빈 배열을 반환하게 되어, 카테고리 목록이 전혀 표시되지 않는 버그를 유발합니다.

아래와 같이 수정하여 두 문제를 한 번에 해결하는 것을 제안합니다.

    return Object.values(CategoryType).map((type: CategoryType) => {
      const data = CATEGORY_DATA[type];
      return new Category(
        type,
        data.title,
        data.description,
        BASE_URL + data.imageUrl
      );
    });

ConfigModule.forRoot({
isGlobal: true,
envFilePath: [`.env.${process.env.NODE_ENV || "development"}`, ".env"],
envFilePath: [".env.development", ".env"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

환경 변수 파일 경로를 .env.development로 고정하셨네요. 이전 방식인 `.env.${process.env.NODE_ENV || "development"}`NODE_ENV 값에 따라 동적으로 설정 파일을 불러올 수 있어 더 유연합니다. 특별한 이유가 없다면 이전 방식으로 되돌려 다양한 환경(테스트, 프로덕션 등)에 쉽게 대응할 수 있도록 하는 것이 좋을 것 같습니다.

Suggested change
envFilePath: [".env.development", ".env"],
envFilePath: [`.env.${process.env.NODE_ENV || "development"}`, ".env"],


@Query(() => [RootQuestion])
async rootQuestionByCategory(
@Args("category") category: CategoryType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

GraphQL enum 타입을 인자로 받을 때는 @Args 데코레이터에 타입을 명시적으로 지정해주는 것이 좋습니다. 이렇게 하면 스키마 생성 시 타입을 명확하게 추론할 수 있습니다. @Args("category", { type: () => CategoryType })와 같이 수정하는 것을 권장합니다.

Suggested change
@Args("category") category: CategoryType
@Args("category", { type: () => CategoryType }) category: CategoryType

Comment on lines 6 to 13
async findAll(): Promise<Category[]> {
return Category.getCategories();
}

async findOne(type: CategoryType): Promise<Category | null> {
const categories = Category.getCategories();
return categories.find((category) => category.type === type) || null;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

findAllfindOne 메소드가 호출될 때마다 Category.getCategories()를 호출하여 카테고리 목록을 새로 생성하고 있습니다. 카테고리 데이터는 정적이므로, 서비스가 생성될 때 한 번만 생성하여 캐싱해두면 불필요한 연산을 줄여 성능을 개선할 수 있습니다. 또한, getCategories는 동기적으로 동작하므로 async/await를 제거할 수 있습니다. 아래와 같이 수정하는 것을 고려해보세요.

  private readonly categories: Category[];

  constructor() {
    this.categories = Category.getCategories();
  }

  findAll(): Category[] {
    return this.categories;
  }

  findOne(type: CategoryType): Category | null {
    return this.categories.find((category) => category.type === type) || null;
  }

@github-actions
Copy link

🛠️ Build Summary

Status: ✅ SUCCESS
Duration: 55초
Exit Code: 0
Commit: c923f68

📋 Build Output (마지막 45줄)

   Generating static pages (1/4) 
   Generating static pages (2/4) 
   Generating static pages (3/4) 
 ✓ Generating static pages (4/4)
   Finalizing page optimization ...
   Collecting build traces ...

Route (pages)                                 Size  First Load JS
┌ ƒ /                                      79.7 kB         638 kB
├   /_app                                      0 B         308 kB
├ ○ /404 (1359 ms)                         1.78 kB         312 kB
├ ○ /500 (1356 ms)                           757 B         308 kB
├ ƒ /api/auth/logout                           0 B         308 kB
├ ƒ /dashboard                             15.2 kB         634 kB
├ ƒ /interviews                            7.87 kB         346 kB
├ ƒ /interviews/[interviewId]              11.6 kB         604 kB
├ ƒ /interviews/[interviewId]/result       5.46 kB         363 kB
├ ○ /layout (1356 ms)                        541 B         308 kB
├   └ css/2af4d3721e97fa9b.css               280 B
├ ƒ /login                                 2.12 kB         312 kB
├ ƒ /login/callback                        1.99 kB         333 kB
├ ƒ /login/profile                         11.3 kB         365 kB
├ ƒ /members/[memberId]                    4.16 kB         338 kB
├ ƒ /members/interviews/[interviewId]      6.83 kB         338 kB
├ ƒ /purchase                              8.82 kB         626 kB
├ ƒ /purchase/confirm                      1.76 kB         333 kB
├ ○ /purchase/error (1356 ms)                804 B         311 kB
├ ƒ /terms/privacy                         5.06 kB         336 kB
└ ƒ /terms/termsofuse                      4.47 kB         336 kB
+ First Load JS shared by all               323 kB
  ├ chunks/framework-962931b100bb889b.js   57.6 kB
  ├ chunks/main-62247af9db6c4a24.js         176 kB
  ├ chunks/pages/_app-c8b8b22867d04788.js  72.4 kB
  ├ css/7b8ee3cf629bbb78.css               15.1 kB
  └ other shared chunks (total)            1.89 kB

ƒ Middleware                               96.7 kB

○  (Static)   prerendered as static content
ƒ  (Dynamic)  server-rendered on demand

   Memory usage report:
    - Total time spent in GC: 364.63ms
    - Peak heap usage: 68.21 MB
    - Peak RSS usage: 680.58 MB

🤖 Generated by GitHub Actions at Fri Sep 19 08:12:10 UTC 2025

@github-actions
Copy link

🚀 Lighthouse Report for TEST1

📅 Date: 9/19/2025

Category Score
🔴 Performance 19
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 1.0 s
🔴 Largest Contentful Paint 10 6.4 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST2

📅 Date: 9/19/2025

Category Score
🔴 Performance 25
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 0.9 s
🔴 Largest Contentful Paint 19 5.5 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST3

📅 Date: 9/19/2025

Category Score
🔴 Performance 31
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 0.9 s
🔴 Largest Contentful Paint 39 4.4 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST4

📅 Date: 9/19/2025

Category Score
🔴 Performance 27
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 0.9 s
🔴 Largest Contentful Paint 21 5.3 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST5

📅 Date: 9/19/2025

Category Score
🔴 Performance 27
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 0.9 s
🔴 Largest Contentful Paint 20 5.4 s
🔴 Cumulative Layout Shift 15 0.518

@github-actions
Copy link

🛠️ Build Summary

Status: ✅ SUCCESS
Duration: 57초
Exit Code: 0
Commit: d7fb928

📋 Build Output (마지막 45줄)

   Generating static pages (1/4) 
   Generating static pages (2/4) 
   Generating static pages (3/4) 
 ✓ Generating static pages (4/4)
   Finalizing page optimization ...
   Collecting build traces ...

Route (pages)                                 Size  First Load JS
┌ ƒ /                                      79.7 kB         638 kB
├   /_app                                      0 B         308 kB
├ ○ /404 (1412 ms)                         1.78 kB         312 kB
├ ○ /500 (1409 ms)                           757 B         308 kB
├ ƒ /api/auth/logout                           0 B         308 kB
├ ƒ /dashboard                             15.2 kB         634 kB
├ ƒ /interviews                            7.87 kB         346 kB
├ ƒ /interviews/[interviewId]              11.6 kB         604 kB
├ ƒ /interviews/[interviewId]/result       5.46 kB         363 kB
├ ○ /layout (1409 ms)                        541 B         308 kB
├   └ css/2af4d3721e97fa9b.css               280 B
├ ƒ /login                                 2.12 kB         312 kB
├ ƒ /login/callback                        1.99 kB         333 kB
├ ƒ /login/profile                         11.3 kB         365 kB
├ ƒ /members/[memberId]                    4.16 kB         338 kB
├ ƒ /members/interviews/[interviewId]      6.83 kB         338 kB
├ ƒ /purchase                              8.82 kB         626 kB
├ ƒ /purchase/confirm                      1.76 kB         333 kB
├ ○ /purchase/error (1408 ms)                804 B         311 kB
├ ƒ /terms/privacy                         5.06 kB         336 kB
└ ƒ /terms/termsofuse                      4.47 kB         336 kB
+ First Load JS shared by all               323 kB
  ├ chunks/framework-962931b100bb889b.js   57.6 kB
  ├ chunks/main-7edd246933c6c162.js         176 kB
  ├ chunks/pages/_app-c8b8b22867d04788.js  72.4 kB
  ├ css/7b8ee3cf629bbb78.css               15.1 kB
  └ other shared chunks (total)            1.89 kB

ƒ Middleware                               96.7 kB

○  (Static)   prerendered as static content
ƒ  (Dynamic)  server-rendered on demand

   Memory usage report:
    - Total time spent in GC: 370.99ms
    - Peak heap usage: 68.46 MB
    - Peak RSS usage: 690.65 MB

🤖 Generated by GitHub Actions at Fri Sep 19 08:16:59 UTC 2025

@github-actions
Copy link

🚀 Lighthouse Report for TEST1

📅 Date: 9/19/2025

Category Score
🔴 Performance 18
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 1.0 s
🔴 Largest Contentful Paint 7 6.8 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST2

📅 Date: 9/19/2025

Category Score
🔴 Performance 26
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 0.9 s
🔴 Largest Contentful Paint 20 5.4 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST3

📅 Date: 9/19/2025

Category Score
🔴 Performance 26
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 0.9 s
🔴 Largest Contentful Paint 17 5.6 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST4

📅 Date: 9/19/2025

Category Score
🔴 Performance 23
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 0.9 s
🔴 Largest Contentful Paint 16 5.7 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST5

📅 Date: 9/19/2025

Category Score
🔴 Performance 27
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 0.9 s
🔴 Largest Contentful Paint 21 5.3 s
🔴 Cumulative Layout Shift 15 0.518

@github-actions
Copy link

🚀 Lighthouse Report for TEST1

📅 Date: 9/19/2025

Category Score
🔴 Performance 19
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 1.0 s
🔴 Largest Contentful Paint 6 7.0 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST2

📅 Date: 9/19/2025

Category Score
🔴 Performance 26
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 1.0 s
🔴 Largest Contentful Paint 22 5.3 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST3

📅 Date: 9/19/2025

Category Score
🔴 Performance 25
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 0.9 s
🔴 Largest Contentful Paint 17 5.7 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST4

📅 Date: 9/19/2025

Category Score
🔴 Performance 26
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 1.0 s
🔴 Largest Contentful Paint 21 5.4 s
🔴 Cumulative Layout Shift 15 0.518

🚀 Lighthouse Report for TEST5

📅 Date: 9/19/2025

Category Score
🔴 Performance 26
🟢 Accessibility 96
🟢 Best Practices 96
🟢 SEO 100

📊 Performance Details

Metric Score Value
🟢 First Contentful Paint 100 0.9 s
🔴 Largest Contentful Paint 21 5.4 s
🔴 Cumulative Layout Shift 15 0.518

@alsgud8311 alsgud8311 merged commit 85ad1b5 into development Sep 19, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] grahiql 적용

1 participant