9 months ago
Hi, I'm trying to add a new variables to a service using the Public API. Although the api has an endpoint for upserting variables and another one for restarting a deployment none of these endpoints apply the changes to the service. It needs to be redeployed manually to take effect. Is this expected? I'm I missing something?
Pinned Solution
5 Replies
9 months ago
I don't use the public API much but I believe I can answer from what I know about Railway. Changes to service variables do require a redeployment to take effect and when you do it within the UI it'll prompt for redeployment (or prompt to Deploy the changes). Restarting a service isn't redeploying it however, it just restarts the container process rather than building a new container.
You'd need to apply new variables and then redeploy the service for the new variables to take effect. You should still be able to do that via the public API via the deploymentRedeploy mutation
dev
I don't use the public API much but I believe I can answer from what I know about Railway. Changes to service variables do require a redeployment to take effect and when you do it within the UI it'll prompt for redeployment (or prompt to Deploy the changes). Restarting a service isn't redeploying it however, it just restarts the container process rather than building a new container.You'd need to apply new variables and then redeploy the service for the new variables to take effect. You should still be able to do that via the public API via the deploymentRedeploy mutation
9 months ago
Thanks for the answer. I can't see any mutation named deploymentRedeploy in the Public API docs. There is only a deploymentRestart which only restarts the container.
dev
Here's what I'm seeing
9 months ago
Excellent! Re reading the docs I've noticed that the queries and mutations provided in https://docs.railway.com/guides/public-api are just a few examples not all of them. My bad. Thanks a lot!
