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

Function graphql

apps/site/next-data/generators/supportersData.mjs:197–213  ·  view source on GitHub ↗
(query, variables = {})

Source from the content-addressed store, hash-verified

195}
196
197const graphql = async (query, variables = {}) => {
198 const res = await fetchWithRetry(GITHUB_GRAPHQL_URL, {
199 method: 'POST',
200 headers: {
201 'Content-Type': 'application/json',
202 Authorization: `Bearer ${GITHUB_READ_API_KEY}`,
203 },
204 body: JSON.stringify({ query, variables }),
205 });
206
207 if (!res.ok) {
208 const text = await res.text();
209 throw new Error(`GitHub API error: ${res.status} ${text}`);
210 }
211
212 return res.json();
213};
214
215/**
216 * Fetches supporters data from Open Collective API and GitHub Sponsors, filters active backers,

Callers 2

fetchSponsorshipsQueryFunction · 0.85
fetchDonationsQueryFunction · 0.85

Calls 1

fetchWithRetryFunction · 0.90

Tested by

no test coverage detected