2 months ago
Summary
I can create Railway projects/services via GraphQL, but linking a GitHub repo to a service via API fails with HTTP 400 “Problem processing request.” Reinstalling the Railway GitHub App with All‑repos
access did not help. Manual UI linking works. This blocks automation (batch of ~60 repos).
Environment
- API: https://backboard.railway.app/graphql/v2
- Token: RAILWAY_TOKEN (works for create project/service/env vars)
- Repo: https://github.com/teebuphilip/wynwood-thoroughbreds
IDs
- Project: b36c4e39-69ad-4129-b769-c1b4aaa9cc6b
- Service: f3416211-37bd-4d95-ace9-ae50404c45ee
Trace IDs
8991915530575196440, 6730767131461453434, 4136615408881108916, 2526255072095093210
Mutations tried (both fail with HTTP 400)
mutation ServiceUpdate($id: String!, $input: ServiceUpdateInput!) {
serviceUpdate(id: $id, input: { source: { repo: "https://github.com/teebuphilip/wynwood-thoroughbreds" } }) { id }
}
mutation ServiceUpdate($id: String!, $input: ServiceUpdateInput!) {
serviceUpdate(id: $id, input: { repo: "https://github.com/teebuphilip/wynwood-thoroughbreds" }) { id }
}
Response
{"errors":[{"message":"Problem processing request","traceId":"..."}]}
Schema errors when checking link status
- Cannot query field "source" on type "Service"
- Cannot query field "repo" on type "Service"
Request
Please confirm the correct GraphQL mutation and schema fields for linking a GitHub repo to a service. If additional fields are required (installation ID, repo ID, owner, etc.), please document/provide
them.
I can provide the full /tmp/railway_debug.log or the script if needed.
1 Replies
2 months ago
Use the serviceConnect mutation instead of serviceUpdate to link a GitHub repo: mutation { serviceConnect(id: "service-id", input: { repo: "owner/repo", branch: "main" }) { id } }. See the Public API docs for full details.
Status changed to Awaiting User Response Railway • 2 months ago
2 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • about 2 months ago