fix: GitHub 공식 GraphQL API로 컨트리뷰션 조회 전환 - #4
Merged
Conversation
기존에 사용하던 github-contributions-api.deno.dev가 Deno Deploy Classic 서비스 종료(2026-07-20)로 사라지면서 모든 애니메이션 요청이 500으로 실패했다. 해당 API는 GitHub GraphQL의 contributionCalendar 응답을 그대로 중계하던 것이라, 공식 API를 직접 호출해도 데이터 구조는 동일하다. 따라서 응답 파싱 로직과 chunkIntoWeeks는 그대로 두고 요청 경로만 교체했다. - GITHUB_TOKEN 환경변수로 api.github.com/graphql 인증 호출 - GraphQL errors 배열과 user null을 구분해 처리하여 실패 원인이 서버 로그에 드러나도록 개선 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01La1oXcrwEZycnLJGdkFn3y
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01La1oXcrwEZycnLJGdkFn3y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사항
/api/[username]/animation요청이 사용자·테마 관계없이 100% 500으로 실패하던 문제를 수정했습니다.원인: 컨트리뷰션 데이터를 가져오던
github-contributions-api.deno.dev가 Deno Deploy Classic 서비스 종료(2026-07-20)로 사라졌습니다.fetchContributions가 404에서 throw하고,route.ts의 catch가 이를 500으로 변환하는 구조라 flower/hair 두 테마 모두 우회 경로가 없었습니다.해결: GitHub 공식 GraphQL API를 직접 호출하도록 교체했습니다. 사라진 API는 GitHub의
contributionCalendar응답을 그대로 중계하던 것이라 (contributionCount,contributionLevel: NONE | FIRST_QUARTILE...등 필드명이 GitHub GraphQL 스키마와 동일) 응답 파싱 로직과chunkIntoWeeks는 변경 없이 요청 경로만 바꾸면 됐습니다.부수적으로 GraphQL
errors배열과user: null을 구분해 처리하여, 실패 시 원인이 서버 로그에 드러나도록 했습니다. (기존에는Failed to fetch contributions for X한 줄이 전부)변경 유형
관련 이슈
없음
테스트 방법
테스트 프레임워크가 없어 실제 함수를 호출하는 검증 스크립트로 확인했습니다. 수정 전 실패를 먼저 확인한 뒤 수정했습니다.
로컬 dev 서버 엔드투엔드:
?theme=flower&quality=lowimage/png431KB, 782x180 APNG (잔디 데이터 정상 렌더)?theme=hair&quality=low&curliness=curlyimage/png114KBCould not resolve to a User with the login of '...'출력체크리스트
pnpm lint통과 (48개 파일)pnpm build통과 (exit 0)스크린샷 (UI 변경 시)
🤖 Generated with Claude Code
https://claude.ai/code/session_01La1oXcrwEZycnLJGdkFn3y