junaid0686
junaid0686
Explore posts from servers
RRailway
Created by junaid0686 on 12/18/2023 in #✋|help
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.
5 replies