From 61c55d6071c3b4fd5024a9f8a1370dd0f4a6cefe Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 9 Feb 2024 17:45:37 +0100 Subject: [PATCH] feat: added scalar attachment --- api/src/modules/system/resolvers.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api/src/modules/system/resolvers.ts b/api/src/modules/system/resolvers.ts index a37f3a55..1851ab66 100644 --- a/api/src/modules/system/resolvers.ts +++ b/api/src/modules/system/resolvers.ts @@ -72,3 +72,16 @@ export const GQLDateBase = scalarType({ return null; }, }); + + +export const GQLAttachmentBase = scalarType({ + name: 'Attachment', + asNexusMethod: 'attachment', + description: 'Attachment custom scalar type', + serialize(value: any) { + return JSON.stringify(value); + }, + parseValue(value: unknown) { + return JSON.parse(value as string); + }, +});