From 35cbbb3c4b1047466db591593e507ffb0861f02d Mon Sep 17 00:00:00 2001 From: akumatus Date: Thu, 13 Feb 2025 06:57:12 +0000 Subject: [PATCH] fix(core): ai context gql file (#10145) --- .../src/graphql/copilot-context-doc-add.gql | 4 ---- .../graphql/copilot-context-doc-remove.gql | 2 +- .../copilot-context-list-docs-and-files.gql | 20 +++++++++++++++++++ .../frontend/graphql/src/graphql/index.ts | 12 +++++++---- packages/frontend/graphql/src/schema.ts | 19 +++++++++--------- 5 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 packages/frontend/graphql/src/graphql/copilot-context-list-docs-and-files.gql diff --git a/packages/frontend/graphql/src/graphql/copilot-context-doc-add.gql b/packages/frontend/graphql/src/graphql/copilot-context-doc-add.gql index f51533580..bb274ed85 100644 --- a/packages/frontend/graphql/src/graphql/copilot-context-doc-add.gql +++ b/packages/frontend/graphql/src/graphql/copilot-context-doc-add.gql @@ -2,9 +2,5 @@ mutation addContextDoc($options: AddContextDocInput!) { addContextDoc(options: $options) { id createdAt - name - chunkSize - status - blobId } } diff --git a/packages/frontend/graphql/src/graphql/copilot-context-doc-remove.gql b/packages/frontend/graphql/src/graphql/copilot-context-doc-remove.gql index e7bf3750f..99220442d 100644 --- a/packages/frontend/graphql/src/graphql/copilot-context-doc-remove.gql +++ b/packages/frontend/graphql/src/graphql/copilot-context-doc-remove.gql @@ -1,3 +1,3 @@ -mutation removeContextDoc($options: RemoveContextFileInput!) { +mutation removeContextDoc($options: RemoveContextDocInput!) { removeContextDoc(options: $options) } diff --git a/packages/frontend/graphql/src/graphql/copilot-context-list-docs-and-files.gql b/packages/frontend/graphql/src/graphql/copilot-context-list-docs-and-files.gql new file mode 100644 index 000000000..3555aa220 --- /dev/null +++ b/packages/frontend/graphql/src/graphql/copilot-context-list-docs-and-files.gql @@ -0,0 +1,20 @@ +query listContextDocsAndFiles($workspaceId: String!, $sessionId: String!, $contextId: String!) { + currentUser { + copilot(workspaceId: $workspaceId) { + contexts(sessionId: $sessionId, contextId: $contextId) { + docs { + id + createdAt + } + files { + id + name + blobId + chunkSize + status + createdAt + } + } + } + } +} \ No newline at end of file diff --git a/packages/frontend/graphql/src/graphql/index.ts b/packages/frontend/graphql/src/graphql/index.ts index 33991cac6..a5d13fbe9 100644 --- a/packages/frontend/graphql/src/graphql/index.ts +++ b/packages/frontend/graphql/src/graphql/index.ts @@ -179,10 +179,6 @@ mutation addContextDoc($options: AddContextDocInput!) { addContextDoc(options: $options) { id createdAt - name - chunkSize - status - blobId } }`, }; @@ -212,6 +208,14 @@ query listContextDocsAndFiles($workspaceId: String!, $sessionId: String!, $conte id createdAt } + files { + id + name + blobId + chunkSize + status + createdAt + } } } } diff --git a/packages/frontend/graphql/src/schema.ts b/packages/frontend/graphql/src/schema.ts index 749b27835..c5278a561 100644 --- a/packages/frontend/graphql/src/schema.ts +++ b/packages/frontend/graphql/src/schema.ts @@ -42,11 +42,6 @@ export interface AddContextDocInput { docId: Scalars['String']['input']; } -export interface RemoveContextDocInput { - contextId: Scalars['String']['input']; - docId: Scalars['String']['input']; -} - export interface AlreadyInSpaceDataType { __typename?: 'AlreadyInSpaceDataType'; spaceId: Scalars['String']['output']; @@ -1315,6 +1310,11 @@ export interface RemoveAvatar { success: Scalars['Boolean']['output']; } +export interface RemoveContextDocInput { + contextId: Scalars['String']['input']; + docId: Scalars['String']['input']; +} + export interface RevokeDocUserRoleInput { docId: Scalars['String']['input']; userId: Scalars['String']['input']; @@ -1952,18 +1952,19 @@ export type AddContextDocMutationVariables = Exact<{ options: AddContextDocInput; }>; -export type RemoveContextDocMutationVariables = Exact<{ - options: RemoveContextDocInput; -}>; - export type AddContextDocMutation = { __typename?: 'Mutation'; addContextDoc: Array<{ __typename?: 'CopilotContextListItem'; id: string; + createdAt: number; }>; }; +export type RemoveContextDocMutationVariables = Exact<{ + options: RemoveContextDocInput; +}>; + export type RemoveContextDocMutation = { __typename?: 'Mutation'; removeContextDoc: boolean;