diff --git a/ee/tabby-schema/graphql/schema.graphql b/ee/tabby-schema/graphql/schema.graphql index e54c94d17977..ffbfbf437d5e 100644 --- a/ee/tabby-schema/graphql/schema.graphql +++ b/ee/tabby-schema/graphql/schema.graphql @@ -715,7 +715,7 @@ type Query { userEvents(after: String, before: String, first: Int, last: Int, users: [ID!], start: DateTime!, end: DateTime!): UserEventConnection! diskUsageStats: DiskUsageStats! repositoryList: [Repository!]! - resolveGitUrl(gitUrl: String!): Repository + resolveGitUrl(gitUrl: String!): Boolean! contextInfo: ContextInfo! integrations(ids: [ID!], kind: IntegrationKind, after: String, before: String, first: Int, last: Int): IntegrationConnection! integratedRepositories(ids: [ID!], kind: IntegrationKind, active: Boolean, after: String, before: String, first: Int, last: Int): ProvidedRepositoryConnection! diff --git a/ee/tabby-schema/src/schema/mod.rs b/ee/tabby-schema/src/schema/mod.rs index 9c9e4c7fb154..0dac0f78413a 100644 --- a/ee/tabby-schema/src/schema/mod.rs +++ b/ee/tabby-schema/src/schema/mod.rs @@ -541,8 +541,8 @@ impl Query { .await } - async fn resolve_git_url(ctx: &Context, git_url: String) -> Result> { - let user = check_user(ctx).await?; + async fn resolve_git_url(ctx: &Context, git_url: String) -> Result { + let user = check_user_and_auth_token(ctx).await?; let repositorys = ctx .locator @@ -553,11 +553,11 @@ impl Query { for repo in repositorys { if repo.git_url == git_url { - return Ok(Some(repo)); + return Ok(true); } } - Ok(None) + return Ok(false); } async fn context_info(ctx: &Context) -> Result { diff --git a/ee/tabby-ui/lib/tabby/gql.ts b/ee/tabby-ui/lib/tabby/gql.ts index 3a87ef9b7e9c..6274cc18f0de 100644 --- a/ee/tabby-ui/lib/tabby/gql.ts +++ b/ee/tabby-ui/lib/tabby/gql.ts @@ -123,7 +123,6 @@ const client = new Client({ ServerInfo: () => null, RepositorySearch: () => null, RepositoryList: () => null, - // IsAvaileableWorkspace: () => null, RepositoryGrep: () => null, GrepLine: () => null, GrepFile: () => null, diff --git a/ee/tabby-ui/lib/tabby/query.ts b/ee/tabby-ui/lib/tabby/query.ts index 800b6e00fc08..dec073975b73 100644 --- a/ee/tabby-ui/lib/tabby/query.ts +++ b/ee/tabby-ui/lib/tabby/query.ts @@ -280,9 +280,9 @@ export const repositoryListQuery = graphql(/* GraphQL */ ` } `) -export const isAvaileableWorkspaceQuery = graphql(/* GraphQL */ ` - query IsAvaileableWorkspace($gitUrl: String!) { - isAvaileableWorkspace(gitUrl: $gitUrl) +export const resolveGitUrlQuery = graphql(/* GraphQL */ ` + query ResolveGitUrl($gitUrl: String!) { + resolveGitUrl(gitUrl: $gitUrl) } `)