GraphQL "Workspace not found"
marco-ohara
PROOP

6 months ago

I know this sounds very basic, but I'm not being able to query the projects of the Workspace I'm working on. It's not "my workspace", it is a team workspace.

I'm using https://railway.com/graphiql for now, to run quick queries and discover the correct way to use the API, but I cannot go further:

query {

workspace (workspaceId: "XXXXX") {

projects (first: 10) {

edges {

node {

id

name

}

}

}

}

}

This is the query I'm running and this is the response:

{

"errors": [

{

"message": "Workspace not found",

"locations": [

{

"line": 2,

"column": 3

}

],

"path": [

"workspace"

],

"extensions": {

"code": "INTERNAL_SERVER_ERROR"

},

"traceId": "8844820811199197203"

}

],

"data": null

}

I already tried with an Account Token and Team Token. The result is the same.
I appreciate the help here.

Solved$10 Bounty

Pinned Solution

6 months ago

I tested the query you provided and it's working completely fine for me. Are you using the correct workspace id?

7 Replies

Railway
BOT

6 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


6 months ago

I tested the query you provided and it's working completely fine for me. Are you using the correct workspace id?


marco-ohara
PROOP

6 months ago

The workspace id is the name of the team (or workspace) right? Where can I find the workspace id? Just to be sure I'm putting the correct value there


6 months ago

No it's not, the workspace id is a unique id for your workspace seperate from the name. I don't actually know if you can find it within the UI, I just snoop the network requests and grab it from there. You can do this via inspect element


6 months ago

I raised this to the team and they just added a button for copying the workspace id!

You can find this button by opening the command pallete (ctrl/cmd + k -> search copy active workspace id), this is the id you'll want to use in that gql request


marco-ohara
PROOP

6 months ago

It worked! Thank you so much!

It would be really useful to be able to obtain this workspace id from either:
- Web UI: Under Workspace Settings -> General Settings -> Workspace Information, as a read only value
- CLI: the CLI only uses team/workspace Name, not id
- GraphQL API: list all workspaces a given token has access to, so you can use these id's as variables too.


6 months ago

Happy I could help! And fair point, feel free to make a Feedback thread (https://station.railway.com/feedback) about that

All clear to mark this as solved?


Status changed to Solved dev 5 months ago


Loading...