fix(nbstore): update workspace blob quota query (#12191)

Change the query for querying quota of Cloud Blob Storage.

The original query used new fields, which caused errors in the old version of the server. This PR uses a simpler query to ensure compatibility.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
  - Added the ability to retrieve a workspace's blob storage quota, including both the raw limit and a human-readable format, via a new query.

- **Bug Fixes**
  - Updated quota retrieval to use the new blob-specific quota query for improved accuracy.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
EYHN
2025-05-08 09:14:54 +00:00
parent 86742c1307
commit 52253e9e82
4 changed files with 51 additions and 2 deletions

View File

@@ -1701,6 +1701,21 @@ export const verifyEmailMutation = {
}`,
};
export const workspaceBlobQuotaQuery = {
id: 'workspaceBlobQuotaQuery' as const,
op: 'workspaceBlobQuota',
query: `query workspaceBlobQuota($id: String!) {
workspace(id: $id) {
quota {
blobLimit
humanReadable {
blobLimit
}
}
}
}`,
};
export const getWorkspaceConfigQuery = {
id: 'getWorkspaceConfigQuery' as const,
op: 'getWorkspaceConfig',

View File

@@ -0,0 +1,10 @@
query workspaceBlobQuota($id: String!) {
workspace(id: $id) {
quota {
blobLimit
humanReadable {
blobLimit
}
}
}
}

View File

@@ -4387,6 +4387,25 @@ export type VerifyEmailMutation = {
verifyEmail: boolean;
};
export type WorkspaceBlobQuotaQueryVariables = Exact<{
id: Scalars['String']['input'];
}>;
export type WorkspaceBlobQuotaQuery = {
__typename?: 'Query';
workspace: {
__typename?: 'WorkspaceType';
quota: {
__typename?: 'WorkspaceQuotaType';
blobLimit: number;
humanReadable: {
__typename?: 'WorkspaceQuotaHumanReadableType';
blobLimit: string;
};
};
};
};
export type GetWorkspaceConfigQueryVariables = Exact<{
id: Scalars['String']['input'];
}>;
@@ -4867,6 +4886,11 @@ export type Queries =
variables: SubscriptionQueryVariables;
response: SubscriptionQuery;
}
| {
name: 'workspaceBlobQuotaQuery';
variables: WorkspaceBlobQuotaQueryVariables;
response: WorkspaceBlobQuotaQuery;
}
| {
name: 'getWorkspaceConfigQuery';
variables: GetWorkspaceConfigQueryVariables;