how to list all projects via graphql?
jonathanykh
PROOP

8 months ago

i have too many projects in railway & i dont want to manually delete each of them in the dashboard
so i want to list them first, get their id, and use the projectDelete method

Solved$10 Bounty

4 Replies

jonathanykh
PROOP

8 months ago

N/A


8 months ago

To get all your projects via graphql you'd use something like this:

query {
  me {
    workspaces {
      id
      team {
        id
        projects {
          edges {
            node {
              id
              name
            }
          }
        }
      }
    }
  }
}

this will fetch all projects across all teams you're apart of


sanyasharma7
FREE

8 months ago

Hi you can try to Automate It with a Script

Here's a simple bash script:

#!/bin/bash TOKEN="<YOUR_TOKEN>" # Get all project IDs project_ids=$(curl -s -H "Authorization: Bearer $TOKEN" https://backboard.railway.app/project | jq -r '.[].id') for id in $project_ids; do echo "Deleting project $id" curl -X DELETE -H "Authorization: Bearer $TOKEN" https://backboard.railway.app/project/$id done


8 months ago

!s


Status changed to Solved dev 8 months ago


Loading...