Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ 피드 조회 API #25

Merged
merged 8 commits into from
May 2, 2024
Merged

✨ 피드 조회 API #25

merged 8 commits into from
May 2, 2024

Conversation

BangDori
Copy link
Collaborator

@BangDori BangDori commented May 2, 2024

작업 이유

피드 조회 API


작업 사항

1️⃣ Query Client 기본 옵션 설정

모든 쿼리의 staleTime, gcTime을 기본값으로 설정해주었습니다.

staleTime과 gcTime의 경우에는 항상 최신화가 필요한 경우에는 0으로 따로 설정해주어 사용하면 될 것 같습니다.

그리고, 페이지에 다시 focus될 때마다 refetch 하는 기능은 불 필요하다고 생각하여 false 처리해두었습니다.

2️⃣ 피드 조회 API 추가

  • 무한 스크롤 구현을 위해 react-infinite-scroller를 적용하였습니다.
  • React Query를 사용할 때, 쿼리 키 관리가 중요하다고 생각하여 queryKey를 관리하는 파일을 따로 생성하였습니다.
  • 현재 타입은 임시적으로 추가해둔 상태입니다. 아마 다음 PR에서 공용 타입들의 경우 shared 폴더로 이동될 것 같습니다.

현재 더미 데이터의 수가 적어, 무한 스크롤이 정상적으로 적용되는지 확인하기 어려운 부분이 있습니다. 그래서 더미 데이터를 추가할 예정입니다.

3️⃣ 작업 예정

피드 메인 페이지 작업 예정 목록에 대해 공유하는 것이 좋을 것 같아서 이렇게 작성합니다.

  1. 🔧 공용 타입 위치 이동 #24 처리
  2. Loading / Error 처리
  3. Feed API 수정, header token 처리 및 더미 데이터 추가
  4. API logging 수정

리뷰어가 중점적으로 확인해야 하는 부분

  • 무한 스크롤이 정상적으로 적용되고 있나요?

발견한 이슈

  • 없음

@BangDori BangDori self-assigned this May 2, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-25.d37mn03xh3qyyz.amplifyapp.com

Copy link
Member

@psychology50 psychology50 left a comment

Choose a reason for hiding this comment

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

어떤 건 Client 쪽 스니펫 같고, 어떤 건 Server 쪽 같은데 간략하게 설명 부탁드릴게요!

Copy link
Member

@Legitgoons Legitgoons left a comment

Choose a reason for hiding this comment

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

무한 스크롤이 정상적으로 작동하는 것을 확인했습니다. 병합하셔도 좋습니다!

src/app/providers/query-client.ts Show resolved Hide resolved
@BangDori BangDori merged commit f20821a into main May 2, 2024
2 checks passed
@BangDori BangDori deleted the feature/PW-269-feed-api branch May 2, 2024 11:39
Legitgoons pushed a commit that referenced this pull request May 4, 2024
- queryClient 옵션 설정
- query key 관리
- react-infinite-scroller 추가
- FeedList에 대한 타입 임시 추가
- #24 에 등록한 이슈로, 공용 타입 설정 후 리팩토링 예정
- 피드 조회 API 적용
- AWS amplify 임시 활성화를 위해, PROD 모드에서도 Mocking 활성화

Closes #PW-269
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.

3 participants