Railway deploys anything from a Git repo — and its GraphQL API lets you manage infrastructure programmatically.
The GraphQL API
# List projects
query {
me {
projects {
edges {
node {
id
name
environments {
edges {
node {
name
deployments(first: 1) {
edges {
node {
status
createdAt
}
}
}
}
}
}
}
}
}
}
}
Deploy via API
# Trigger a deployment
curl -X POST https://backboard.railway.app/graphql/v2 \
-H "Authorization: Bearer $RAILWAY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation { serviceDeploymentRedeploy(input: { environmentId: "ENV_ID", serviceId: "SVC_ID" }) { id status } }"
}'
One-Click Services
# Deploy PostgreSQL
railway add --plugin postgresql
# Deploy Redis
railway add --plugin redis
# Your app gets connection strings as env vars automatically
Environment Variables API
# Set variables
curl -X POST https://backboard.railway.app/graphql/v2 \
-H "Authorization: Bearer $RAILWAY_TOKEN" \
-d '{
"query": "mutation { variableUpsert(input: { projectId: "...", environmentId: "...", serviceId: "...", name: "API_KEY", value: "secret123" }) }"
}'
railway.json — Infrastructure as Code
{
"$schema": "https://railway.app/railway.schema.json",
"build": { "builder": "NIXPACKS" },
"deploy": {
"startCommand": "node dist/server.js",
"healthcheckPath": "/health",
"restartPolicyType": "ON_FAILURE"
}
}
Real-World Use Case
A team was using Heroku for 3 services + add-ons (PostgreSQL, Redis, cron). Monthly bill: $75. After Heroku killed free tier, they moved to Railway: same setup, connected via internal networking, preview environments per PR. Monthly bill: $10. Migration took 1 hour.
Railway is Heroku done right for 2026.
Build Smarter Data Pipelines
Need to scrape websites, extract APIs, or automate data collection? Check out my ready-to-use scrapers on Apify — no coding required.
Custom scraping solution? Email me at spinov001@gmail.com — fast turnaround, fair prices.
Top comments (0)