diff --git a/src/Schemas/index.ts b/src/Schemas/index.ts index 2c7e3f34..f943a4e2 100644 --- a/src/Schemas/index.ts +++ b/src/Schemas/index.ts @@ -56,6 +56,14 @@ export const queryUserRepository = ` } } } + gists(first: 100, orderBy: {direction: DESC, field: UPDATED_AT}) { + totalCount + nodes { + stargazers { + totalCount + } + } + } } } `; diff --git a/src/user_info.ts b/src/user_info.ts index 805402d6..9666d965 100644 --- a/src/user_info.ts +++ b/src/user_info.ts @@ -4,11 +4,18 @@ type Repository = { languages: { nodes: Language[] }; stargazers: Stargazers; }; +type Gist = { + stargazers: Stargazers; +}; export type GitHubUserRepository = { repositories: { totalCount: number; nodes: Repository[]; }; + gists: { + totalCount: number; + nodes: Gist[]; + }; }; export type GitHubUserIssue = { @@ -69,6 +76,12 @@ export class UserInfo { return prev + node.stargazers.totalCount; }, 0, + ) + + userRepository.gists.nodes.reduce( + (prev: number, node: Gist) => { + return prev + node.stargazers.totalCount; + }, + 0, ); const languages = new Set();