From 3a160efd17c7fb0b89c1659f8b4496a4129e9e10 Mon Sep 17 00:00:00 2001 From: Bivekich Date: Mon, 30 Jun 2025 00:46:45 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=B2=20=D1=82=D0=B8=D0=BF=20LaximoFulltextDeta?= =?UTF-8?q?il=20=D0=B8=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=20=D1=80=D0=B5=D0=B7=D0=BE=D0=BB=D0=B2=D0=B5=D1=80=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BC=D0=B0=D0=BF=D0=BF=D0=B8=D0=BD=D0=B3=D0=B0?= =?UTF-8?q?=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85,=20=D0=B2=D0=BA=D0=BB?= =?UTF-8?q?=D1=8E=D1=87=D0=B0=D1=8F=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D1=83=20=D0=BE=D1=82=D1=81=D1=83=D1=82=D1=81=D1=82?= =?UTF-8?q?=D0=B2=D1=83=D1=8E=D1=89=D0=B8=D1=85=20=D0=BF=D0=BE=D0=BB=D0=B5?= =?UTF-8?q?=D0=B9.=20=D0=AD=D1=82=D0=BE=20=D1=83=D0=BB=D1=83=D1=87=D1=88?= =?UTF-8?q?=D0=B0=D0=B5=D1=82=20=D1=81=D0=BE=D0=BE=D1=82=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=D1=81=D1=82=D0=B2=D0=B8=D0=B5=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20GraphQL=20=D1=81=D1=85=D0=B5=D0=BC=D0=B5=20=D0=B8=20?= =?UTF-8?q?=D0=BE=D0=B1=D0=B5=D1=81=D0=BF=D0=B5=D1=87=D0=B8=D0=B2=D0=B0?= =?UTF-8?q?=D0=B5=D1=82=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=BD=D0=BE=D0=B5=20=D0=BF=D1=80=D0=B5=D0=B4=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=B5=D1=82?= =?UTF-8?q?=D0=B0=D0=BB=D0=B5=D0=B9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/graphql/resolvers.ts | 23 +++++++++++++++++++++++ src/lib/graphql/typeDefs.ts | 10 ++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/lib/graphql/resolvers.ts b/src/lib/graphql/resolvers.ts index d02aedd..c693173 100644 --- a/src/lib/graphql/resolvers.ts +++ b/src/lib/graphql/resolvers.ts @@ -1927,6 +1927,29 @@ export const resolvers = { result.details.length ) } + + // Мапим данные для GraphQL схемы, добавляя отсутствующие поля + if (result) { + return { + ...result, + details: result.details.map(detail => ({ + detailid: null, // Полнотекстовый поиск не возвращает detailid + oem: detail.oem, + formattedoem: detail.oem, // Используем oem как formattedoem + name: detail.name, + brand: detail.brand || null, + description: detail.description || null, + codeonimage: null, + code: null, + note: null, + filter: null, + parttype: null, + price: null, + availability: null, + attributes: [] + })) + } + } return result } catch (err) { diff --git a/src/lib/graphql/typeDefs.ts b/src/lib/graphql/typeDefs.ts index ba428e3..ee08aa8 100644 --- a/src/lib/graphql/typeDefs.ts +++ b/src/lib/graphql/typeDefs.ts @@ -1473,10 +1473,20 @@ export const typeDefs = gql` } type LaximoFulltextDetail { + detailid: String oem: String! + formattedoem: String name: String! brand: String description: String + codeonimage: String + code: String + note: String + filter: String + parttype: String + price: String + availability: String + attributes: [LaximoDetailAttribute!] } # Типы для Doc FindOEM