[category] 카테고리 전체 조회/검색 API 추가#45
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements the Category Query and Search APIs by introducing new inbound use cases, services, and a GraphQL web adapter. It also extends the outbound persistence layer with QueryDSL-based queries to fetch all categories or search them by keyword. The feedback suggests trimming the search keyword in SearchCategoriesService to handle leading or trailing whitespaces robustly, along with updating the unit tests to verify this behavior.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements the category query and search APIs, including the addition of a detailed implementation plan, GraphQL schema updates, UseCases, services, and QueryDSL-based persistence adapters. The reviewer suggested optimizing the read-only operations in FetchCategoriesService and SearchCategoriesService by adding the @transactional(readOnly = true) annotation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
개요
category도메인에는 지금까지domain/port/out/adapter/out(영속성) 계층만 존재하고, 카테고리를 직접 조회하는 GraphQL Query가 없었습니다. 이번 PR에서 전체 카테고리 목록 조회(categories)와 키워드 기반 검색(searchCategories) Query를 추가하였습니다.변경 사항
CategoryPersistencePort에findAll(),searchByKeyword(keyword)추가CategoryPersistenceAdapter에JPAQueryFactory기반 QueryDSL 구현을 추가하였습니다 (categoryId 오름차순 정렬, 영문명/한글명 대소문자 무시 부분일치 검색). 기존ScorePersistenceAdapter의 QueryDSL 사용 방식과 일관성을 맞추었습니다FetchCategoriesUseCase/FetchCategoriesService,SearchCategoriesUseCase/SearchCategoriesService를 각각 추가하여 조회와 검색 책임을 분리하였습니다CategoryPayloadDTO와Category.toPayload()확장함수를 추가하였습니다. 기존CategoryGraphQL 타입(Score에서 이미 사용 중)의 필드명을 그대로 쓰지 않고, 응답 전용 필드명(englishName,koreanName,maxRecordCount)으로 매핑하였고, 이후 다른 Mutation 호출 시 필요한categoryType도 함께 포함하였습니다CategoryWebAdapter에categories,searchCategories(keyword)Query 리졸버를 추가하였습니다category.graphqls에CategoryPayload타입과extend type Query를 추가하였습니다FetchCategoriesServiceTest,SearchCategoriesServiceTest,CategoryPayloadTest)을 추가하였습니다docs/plans/category-query-api-plan.md)를 추가하였습니다참고 사항
searchCategories에 keyword를 전달하지 않거나 빈 문자열/공백을 전달하면categories와 동일하게 전체 목록을 반환합니다/graphql엔드포인트의 JWT 인증 정책을 그대로 따르며, 역할별 제한은 두지 않았습니다체크리스트
README,.env.example)