feat: update graphql query to read token (#829)

release-fix-intellij-update-support-version-range
Eric 2023-11-19 02:03:33 +08:00 committed by GitHub
parent 530e142d63
commit 8dd245ef30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -25,7 +25,7 @@ serde.workspace = true
tabby-common = { path = "../../crates/tabby-common" }
tarpc = { version = "0.33.0", features = ["serde-transport"] }
thiserror.workspace = true
tokio.workspace = true
tokio = { workspace = true, features = ["fs"] }
tokio-rusqlite = "0.4.0"
tokio-tungstenite = "0.20.1"
tracing.workspace = true

View File

@ -9,6 +9,7 @@ type Mutation {
type Query {
workers: [Worker!]!
registrationToken: String!
}
type Worker {

View File

@ -13,6 +13,11 @@ impl Query {
async fn workers(ctx: &ServerContext) -> Vec<Worker> {
ctx.list_workers().await
}
async fn registration_token(ctx: &ServerContext) -> FieldResult<String> {
let token = ctx.read_registration_token().await?;
Ok(token)
}
}
#[derive(Default)]