affaan-m/ECC · error

GitHub GraphQL returned errors

Error message

GitHub GraphQL returned errors

What it means

githubGraphql received a 200 response whose payload contained a top-level `errors` array, meaning GraphQL executed but the query failed (e.g. bad token scope, missing node). The error details are in the discarded payload.

Source

Thrown at scripts/discord/release-announce.mjs:37

async function request(url, options = {}, attempts = 3) {
  for (let attempt = 1; attempt <= attempts; attempt += 1) {
    const response = await fetch(url, options);
    if (response.status !== 429 || attempt === attempts) return response;
    const data = await response.json().catch(() => ({}));
    await sleep(Math.min(Number(data.retry_after || 1) * 1000 + 250, 10_000));
  }
  throw new Error('request retry budget exhausted');
}

async function githubGraphql(query, variables) {
  const response = await request('https://api.github.com/graphql', {
    method: 'POST',
    headers: { Authorization: `Bearer ${env.GITHUB_TOKEN}`, 'Content-Type': 'application/json' },
    body: JSON.stringify({ query, variables }),
  });
  if (!response.ok) throw new Error(`GitHub GraphQL request failed (${response.status})`);
  const payload = await response.json();
  if (payload.errors) throw new Error('GitHub GraphQL returned errors');
  return payload.data;
}

async function releaseFromGitHub() {
  const [owner, repo] = env.GITHUB_REPOSITORY.split('/');
  const tag = env.RELEASE_TAG || env.GITHUB_REF_NAME;
  const response = await request(`https://api.github.com/repos/${owner}/${repo}/releases/tags/${encodeURIComponent(tag)}`, {
    headers: { Authorization: `Bearer ${env.GITHUB_TOKEN}`, Accept: 'application/vnd.github+json' },
  });
  if (!response.ok) throw new Error(`release lookup failed (${response.status})`);
  return response.json();
}

async function createOrFindReleaseDiscussion() {
  const release = await releaseFromGitHub();
  const [owner, name] = env.GITHUB_REPOSITORY.split('/');
  const marker = releaseMarker(release.tag_name);
  const data = await githubGraphql(

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Inspect the underlying error detail in the message (stderr/log/HTTP status), fix the cause, and retry.
Defensive patterns

Strategy: retry

When it happens

Trigger: Triggered when release-announce.mjs rejects the current invocation: GitHub GraphQL returned errors

Common situations: Occurs while running scripts/discord/release-announce.mjs with invalid arguments, missing flags, or a failing external dependency; the guard at scripts/discord/release-announce.mjs:37 aborts the command with this message.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/bf71f635030cce90. Report an issue: GitHub.