MCPcopy Index your code
hub / github.com/nodejs/nodejs.org / fetchDonationsQuery

Function fetchDonationsQuery

apps/site/next-data/generators/supportersData.mjs:173–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

171}
172
173async function fetchDonationsQuery() {
174 const data = await graphql(DONATIONS_QUERY);
175
176 if (data.errors) {
177 throw new Error(JSON.stringify(data.errors));
178 }
179
180 const nodeRes = data.data.organization?.sponsorsActivities;
181 if (!nodeRes) {
182 return [];
183 }
184
185 const { nodes } = nodeRes;
186 return nodes.map(n => {
187 const s = n.sponsor || n.sponsorEntity; // support different field names
188 return {
189 name: s?.name || s?.login || null,
190 image: s?.avatarUrl || null,
191 url: s?.url || null,
192 source: 'github',
193 };
194 });
195}
196
197const graphql = async (query, variables = {}) => {
198 const res = await fetchWithRetry(GITHUB_GRAPHQL_URL, {

Callers 1

fetchGithubSponsorsDataFunction · 0.85

Calls 1

graphqlFunction · 0.85

Tested by

no test coverage detected