MCPcopy Index your code
hub / github.com/BingyanStudio/github-analyzer / fetchUserDataBatched

Function fetchUserDataBatched

api/src/services/generateReport.ts:97–180  ·  view source on GitHub ↗
(
  octokit: Octokit,
  login: string,
  userId: string
)

Source from the content-addressed store, hash-verified

95}
96
97async function fetchUserDataBatched(
98 octokit: Octokit,
99 login: string,
100 userId: string
101): Promise<Omit<UserData, "profileContent">> {
102 console.log(`Fetching fresh user data for ${login}`);
103 const commitData: any = await octokit.graphql(`
104 query {
105 user(login: "${login}") {
106 name
107 bio
108 location
109 status {
110 emoji
111 message
112 }
113 pullRequests(first: 20, orderBy: {
114 field: CREATED_AT
115 direction: DESC
116 }) {
117 nodes {
118 repository {
119 nameWithOwner
120 description
121 }
122 title
123 body
124 createdAt
125 }
126 }
127 repositoriesContributedTo(
128 first: 20
129 privacy: PUBLIC
130 orderBy: {
131 field: UPDATED_AT
132 direction: DESC
133 }
134 includeUserRepositories: true
135 contributionTypes: [COMMIT]
136 ) {
137 nodes {
138 description
139 nameWithOwner
140 mainCommits: defaultBranchRef {
141 target {
142 ... on Commit {
143 history(
144 first: 30
145 author: {id: "${userId}"}
146 since: "2023-04-01T00:00:00Z"
147 ) {
148 nodes {
149 message
150 committedDate
151 }
152 }
153 }
154 }

Callers 1

fetchUserDataFunction · 0.85

Calls 2

parseCommitsFunction · 0.85
parsePullRequestsFunction · 0.85

Tested by

no test coverage detected