Deploy postgres via API
andremaytorena
PROOP

2 months ago

Hey guys, I've currently got this mutation:

SERVICE_CREATE_MUTATION = """
mutation ServiceCreate($input: ServiceCreateInput!) {
  serviceCreate(input: $input) {
    id
    name
    projectId
  }
}
""".strip()

variables = {
        "input": {
            "projectId": resolved_project_id,
            "name": service_name.strip(),
            "source": {
                "image": image,
            },
        }
    }

    data = railway_graphql(SERVICE_CREATE_MUTATION, variables, token, token_type, endpoint=endpoint)```

It deploys the service but not an actual postgres service with a volume attached, is there a different way of doing it?
$10 Bounty

2 Replies

You can use templateDeployV2 to deploy the postgres template.

mutation templateDeployV2($input: TemplateDeployV2Input!) {
  templateDeployV2(input: $input) {
    projectId
    workflowId
  }
}

andremaytorena
PROOP

2 months ago

Yeah ended up copying the browser one


Welcome!

Sign in to your Railway account to join the conversation.

Loading...