From 76f2c31e46ffb7fcffb1d21d4ad5094075078c97 Mon Sep 17 00:00:00 2001 From: darkskygit Date: Thu, 12 Dec 2024 14:38:09 +0000 Subject: [PATCH] fix(core): gql file upload (#9134) --- packages/frontend/graphql/export-gql-plugin.cjs | 2 +- packages/frontend/graphql/src/graphql/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend/graphql/export-gql-plugin.cjs b/packages/frontend/graphql/export-gql-plugin.cjs index 0d8baf2522..27322de6a6 100644 --- a/packages/frontend/graphql/export-gql-plugin.cjs +++ b/packages/frontend/graphql/export-gql-plugin.cjs @@ -138,7 +138,7 @@ module.exports = { if (schema.getType(type)?.name === 'Upload') return true; const typeDef = schema.getType(type); const fields = typeDef.getFields?.(); - if (!fields || !fields.length) return false; + if (!fields || typeof fields !== 'object') return false; for (let field of Object.values(fields)) { let type = field.type; while (type.ofType) { diff --git a/packages/frontend/graphql/src/graphql/index.ts b/packages/frontend/graphql/src/graphql/index.ts index 8b09b06891..9c3417caf0 100644 --- a/packages/frontend/graphql/src/graphql/index.ts +++ b/packages/frontend/graphql/src/graphql/index.ts @@ -188,7 +188,7 @@ export const createCopilotMessageMutation = { id: 'createCopilotMessageMutation' as const, operationName: 'createCopilotMessage', definitionName: 'createCopilotMessage', - containsFile: false, + containsFile: true, query: ` mutation createCopilotMessage($options: CreateChatMessageInput!) { createCopilotMessage(options: $options)