mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 06:16:42 +00:00
Fixed Railway domain & logs
X-Lovable-Edit-ID: edt-bc4d3504-648e-4f5d-ae73-1cb65d5ea9dc Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
commit
4b9a703c56
1 changed files with 7 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// Helper para chamar a Railway GraphQL API (Public API).
|
||||
// Docs: https://docs.railway.com/reference/public-api
|
||||
const RAILWAY_GRAPHQL = "https://backboard.railway.com/graphql/v2";
|
||||
const RAILWAY_GRAPHQL = "https://backboard.railway.app/graphql/v2";
|
||||
|
||||
export interface RailwayError {
|
||||
message: string;
|
||||
|
|
@ -24,10 +24,15 @@ export async function railwayQuery<T>(
|
|||
|
||||
if (!res.ok) {
|
||||
const text = await res.text();
|
||||
console.error(`Railway HTTP ${res.status} for query:`, query.trim().split("\n")[1]?.trim(), "vars:", JSON.stringify(variables), "body:", text);
|
||||
throw new Error(`Railway HTTP ${res.status}: ${text}`);
|
||||
}
|
||||
|
||||
return res.json();
|
||||
const json = await res.json();
|
||||
if (json.errors?.length) {
|
||||
console.error("Railway GraphQL errors:", JSON.stringify(json.errors), "for vars:", JSON.stringify(variables));
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
export async function createRailwayService(opts: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue