feat(server): add all ignored docs endpoint (#11953)

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

- **New Features**
  - Added the ability to view a complete list of ignored documents for a workspace without pagination.
  - Introduced separate options to add or remove ignored documents from workspace embeddings.
  - Added a new query to fetch all ignored documents for a workspace, including document IDs and creation timestamps.

- **Refactor**
  - Reorganized and clarified GraphQL mutations and queries related to managing ignored documents in workspace embeddings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
darkskygit
2025-04-24 04:12:43 +00:00
parent 652cdedfc3
commit b4ed7d35a1
10 changed files with 122 additions and 41 deletions

View File

@@ -31,6 +31,7 @@ import { MAX_EMBEDDABLE_SIZE } from '../types';
import { CopilotWorkspaceService } from './service';
import {
CopilotWorkspaceFileType,
CopilotWorkspaceIgnoredDocType,
PaginatedCopilotWorkspaceFileType,
PaginatedIgnoredDocsType,
} from './types';
@@ -90,6 +91,18 @@ export class CopilotWorkspaceEmbeddingConfigResolver {
return paginate(ignoredDocs, 'createdAt', pagination, totalCount);
}
@ResolveField(() => [CopilotWorkspaceIgnoredDocType], {
complexity: 2,
})
async allIgnoredDocs(
@Parent() config: CopilotWorkspaceConfigType
): Promise<CopilotWorkspaceIgnoredDocType[]> {
const [ignoredDocs] = await this.copilotWorkspace.listIgnoredDocs(
config.workspaceId
);
return ignoredDocs;
}
@Mutation(() => Number, {
name: 'updateWorkspaceEmbeddingIgnoredDocs',
complexity: 2,

View File

@@ -273,6 +273,7 @@ type CopilotSessionType {
}
type CopilotWorkspaceConfig {
allIgnoredDocs: [CopilotWorkspaceIgnoredDoc!]!
files(pagination: PaginationInput!): PaginatedCopilotWorkspaceFileType!
ignoredDocs(pagination: PaginationInput!): PaginatedIgnoredDocsType!
workspaceId: String!