// GraphQL reports failures with a 200 status code and an `errors` array.
if (Array.isArray(json.errors) && json.errors.length > 0) {
return typeof error?.message === 'string'
? error.message
: JSON.stringify(error);
this._logService.error(`[AgentHostOctoKit] POST ${url} - GraphQL error: ${message}`);
throw new Error(`GitHub GraphQL request failed: ${message}`);
}
return json.data;