(query, variables = {})
| 195 | } |
| 196 | |
| 197 | const 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, |
no test coverage detected