Skip to content

Commit

Permalink
feat: update graphql query to read token (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
darknight authored Nov 18, 2023
1 parent 530e142 commit 8dd245e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ee/tabby-webserver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ee/tabby-webserver/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Mutation {

type Query {
workers: [Worker!]!
registrationToken: String!
}

type Worker {
Expand Down
5 changes: 5 additions & 0 deletions ee/tabby-webserver/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit 8dd245e

Please sign in to comment.