deploy github user contribution endpoint to cloudflare

This commit is contained in:
platane
2025-02-20 23:43:25 +07:00
parent 10c4c3c7bd
commit 852f0ae376
9 changed files with 257 additions and 287 deletions

View File

@@ -42,12 +42,13 @@ export const getGithubUserContribution = async (
headers: {
Authorization: `bearer ${o.githubToken}`,
"Content-Type": "application/json",
"User-Agent": "me@platane.me",
},
method: "POST",
body: JSON.stringify({ variables, query }),
});
if (!res.ok) throw new Error(res.statusText);
if (!res.ok) throw new Error(await res.text().catch(() => res.statusText));
const { data, errors } = (await res.json()) as {
data: GraphQLRes;