diff --git a/packages/api/src/resolvers/function_resolvers.ts b/packages/api/src/resolvers/function_resolvers.ts index 018a52c9b..81d3edfd8 100644 --- a/packages/api/src/resolvers/function_resolvers.ts +++ b/packages/api/src/resolvers/function_resolvers.ts @@ -475,11 +475,7 @@ export const functionResolvers = { _: { input: ArticleHighlightsInput }, ctx: WithDataSourcesContext ) { - const highlights = article.highlights?.map((h) => ({ - ...h, - type: h.type ?? HighlightType.Highlight, - })) - return highlights || [] + return article.highlights || [] }, async shareInfo( article: { id: string; sharedBy?: User; shareInfo?: LinkShareInfo }, @@ -538,6 +534,9 @@ export const functionResolvers = { ) { return highlight.createdByMe ?? highlight.userId === ctx.claims?.uid }, + type(highlight: { type: HighlightType }) { + return highlight.type || HighlightType.Highlight + }, }, Reaction: { async user(