feat: update graphql query to read token (#829)
parent
530e142d63
commit
8dd245ef30
|
|
@ -25,7 +25,7 @@ serde.workspace = true
|
||||||
tabby-common = { path = "../../crates/tabby-common" }
|
tabby-common = { path = "../../crates/tabby-common" }
|
||||||
tarpc = { version = "0.33.0", features = ["serde-transport"] }
|
tarpc = { version = "0.33.0", features = ["serde-transport"] }
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
tokio.workspace = true
|
tokio = { workspace = true, features = ["fs"] }
|
||||||
tokio-rusqlite = "0.4.0"
|
tokio-rusqlite = "0.4.0"
|
||||||
tokio-tungstenite = "0.20.1"
|
tokio-tungstenite = "0.20.1"
|
||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ type Mutation {
|
||||||
|
|
||||||
type Query {
|
type Query {
|
||||||
workers: [Worker!]!
|
workers: [Worker!]!
|
||||||
|
registrationToken: String!
|
||||||
}
|
}
|
||||||
|
|
||||||
type Worker {
|
type Worker {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,11 @@ impl Query {
|
||||||
async fn workers(ctx: &ServerContext) -> Vec<Worker> {
|
async fn workers(ctx: &ServerContext) -> Vec<Worker> {
|
||||||
ctx.list_workers().await
|
ctx.list_workers().await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn registration_token(ctx: &ServerContext) -> FieldResult<String> {
|
||||||
|
let token = ctx.read_registration_token().await?;
|
||||||
|
Ok(token)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue