11import { ContributionTotals , GitHubUserData , PullRequestNode , RepoNode } from "@/types/github" ;
2+ import { graphql } from "@octokit/graphql" ;
23
34type GitHubRawUser = {
45 name : string | null ;
@@ -7,7 +8,6 @@ type GitHubRawUser = {
78 pullRequests : { nodes : PullRequestNode [ ] } ;
89 contributionsCollection : ContributionTotals ;
910} ;
10- import { graphql } from "@octokit/graphql" ;
1111
1212if ( ! process . env . GITHUB_TOKEN ) {
1313 throw new Error ( "Missing GITHUB_TOKEN" ) ;
@@ -24,7 +24,7 @@ const QUERY = /* GraphQL */ `
2424 query FetchUserData($login: String!, $repoCount: Int = 100, $prCount: Int = 100) {
2525 user(login: $login) {
2626 name
27- avatarUrl
27+ avatarUrl(size: 80)
2828 repositories(
2929 first: $repoCount
3030 privacy: PUBLIC
@@ -77,10 +77,10 @@ export async function fetchGitHubUserData(
7777 }
7878
7979 return {
80- name : user . name as string | null ,
81- avatarUrl : user . avatarUrl as string ,
82- repos : user . repositories . nodes as RepoNode [ ] ,
83- pullRequests : user . pullRequests . nodes as PullRequestNode [ ] ,
84- contributions : user . contributionsCollection as ContributionTotals ,
80+ name : user . name ,
81+ avatarUrl : user . avatarUrl ,
82+ repos : user . repositories . nodes ,
83+ pullRequests : user . pullRequests . nodes ,
84+ contributions : user . contributionsCollection ,
8585 } ;
8686}
0 commit comments