MCPcopy
hub / github.com/graphql/graphql-spec / fetchProfileNames

Function fetchProfileNames

scripts/generate-contributor-list.mjs:209–224  ·  view source on GitHub ↗
(logins)

Source from the content-addressed store, hash-verified

207 return "";
208}
209async function fetchProfileNames(logins) {
210 const out = new Map();
211 const chunkSize = 40;
212 for (let i = 0; i < logins.length; i += chunkSize) {
213 const chunk = logins.slice(i, i + chunkSize);
214 const fields = chunk.map((login, idx) => `u${idx}: user(login: "${login}") { login name }`).join("\n");
215 const q = `query { ${fields} }`;
216 const r = await graphql(q);
217 const data = r?.data || {};
218 for (let idx = 0; idx < chunk.length; idx++) {
219 const u = data[`u${idx}`];
220 out.set(chunk[idx], (u?.name || "").trim());
221 }
222 }
223 return out;
224}
225
226// ---------- main
227async function main() {

Callers 1

mainFunction · 0.85

Calls 1

graphqlFunction · 0.85

Tested by

no test coverage detected