GraphQL API Token not working

I'm trying to use Railway's GraphQL API with tokens I have created. When I create a token connected to a team, I get a Not Authorized error on the GraphQL Playground. When I run the query with a token not connected to the team, the query works. Here is the query:
query dashboard {
me {
...DashboardFields
}
}

fragment DashboardFields on User {
id
email
name
avatar
createdAt
lastLogin
isAdmin
banReason
agreedFairUse
customer {
state
}
projects {
edges {
node {
...DashboardProjectFields
}
}
}
teams {
edges {
node {
id
name
avatar
customer {
state
}
projects {
edges {
node {
...DashboardProjectFields
}
}
}
}
}
}
}

fragment DashboardProjectFields on Project {
id
name
description
plugins {
edges {
node {
...PluginFields
}
}
}
services {
edges {
node {
...DashboardServiceFields
}
}
}
}

fragment PluginFields on Plugin {
id
name
friendlyName
status
createdAt
logsEnabled
containers {
edges {
node {
...ContainerFields
}
}
}
migrationDatabaseServiceId
}

fragment ContainerFields on Container {
environmentId
pluginId
deletedAt
}

fragment DashboardServiceFields on Service {
id
name
icon
createdAt
projectId
deployments(first: 1) {
edges {
node {
...DashboardDeploymentFields
}
}
}
}

fragment DashboardDeploymentFields on Deployment {
createdAt
status
staticUrl
}
query dashboard {
me {
...DashboardFields
}
}

fragment DashboardFields on User {
id
email
name
avatar
createdAt
lastLogin
isAdmin
banReason
agreedFairUse
customer {
state
}
projects {
edges {
node {
...DashboardProjectFields
}
}
}
teams {
edges {
node {
id
name
avatar
customer {
state
}
projects {
edges {
node {
...DashboardProjectFields
}
}
}
}
}
}
}

fragment DashboardProjectFields on Project {
id
name
description
plugins {
edges {
node {
...PluginFields
}
}
}
services {
edges {
node {
...DashboardServiceFields
}
}
}
}

fragment PluginFields on Plugin {
id
name
friendlyName
status
createdAt
logsEnabled
containers {
edges {
node {
...ContainerFields
}
}
}
migrationDatabaseServiceId
}

fragment ContainerFields on Container {
environmentId
pluginId
deletedAt
}

fragment DashboardServiceFields on Service {
id
name
icon
createdAt
projectId
deployments(first: 1) {
edges {
node {
...DashboardDeploymentFields
}
}
}
}

fragment DashboardDeploymentFields on Deployment {
createdAt
status
staticUrl
}
You can test by creating 2 keys and then running a query on the GraphQL Playground. The Authorization should be added a header.
4 Replies
Percy
Percy12mo ago
Project ID: 24e44d2f-a2e6-43e7-a692-f517f5e38c3b
junaid0686
junaid0686OP12mo ago
24e44d2f-a2e6-43e7-a692-f517f5e38c3b
Brody
Brody12mo ago
you can't query for the personal accounts data with a token generated for a team
junaid0686
junaid0686OP12mo ago
Oh ok, let me test with my actual queries and I will message if the issue persists
Want results from more Discord servers?
Add your server