| name | github-graphql |
| description | GitHub GraphQL API 가이드. GraphQL 쿼리 작성, Rate Limit 처리, User/ContributionsCollection 조회, 페이지네이션 등. GitHub API, GraphQL, contributionsCollection 키워드 또는 GitHub API 관련 코드 작업 시 자동 로드. |
GitHub GraphQL API 가이드
GitHub GraphQL API를 사용한 데이터 조회 및 조작을 위한 참조 문서입니다.
핵심 요약
엔드포인트
POST https://api.github.com/graphql
인증
curl -H "Authorization: Bearer {TOKEN}" \
-X POST \
-d '{"query": "query { viewer { login }}"}' \
https://api.github.com/graphql
Rate Limit
| 인증 방식 | 제한 |
|---|
| Personal Access Token | 시간당 5,000 포인트 |
| GitHub App (Enterprise Cloud) | 시간당 10,000 포인트 |
| GitHub Actions GITHUB_TOKEN | 리포지토리당 시간당 1,000 포인트 |
상태 확인 헤더:
x-ratelimit-remaining: 잔여 포인트
x-ratelimit-reset: 재설정 시간 (Unix timestamp)
자주 사용하는 쿼리
사용자 기여 조회
query($username: String!) {
user(login: $username) {
contributionsCollection {
totalCommitContributions
totalIssueContributions
totalPullRequestContributions
totalPullRequestReviewContributions
}
}
}
Rate Limit 확인
query {
rateLimit {
limit
remaining
used
resetAt
}
}
페이지네이션
query($owner: String!, $name: String!) {
repository(owner: $owner, name: $name) {
issues(first: 100, after: $cursor) {
nodes { title }
pageInfo {
endCursor
hasNextPage
}
}
}
}
상세 문서
참조 링크