From eda0960a1edbdbab426a7c08c22ba9b8beedda87 Mon Sep 17 00:00:00 2001 From: Chris Bongers Date: Tue, 9 Dec 2025 14:50:43 +0200 Subject: [PATCH 1/3] chore: missed one type --- src/schema/opportunity.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schema/opportunity.ts b/src/schema/opportunity.ts index 864b25c064..9cb10898e8 100644 --- a/src/schema/opportunity.ts +++ b/src/schema/opportunity.ts @@ -166,7 +166,7 @@ export interface GQLOpportunityPreviewResult { totalCount: number; tags: string[] | null; companies: Array<{ name: string; favicon?: string }> | null; - squads: string[] | null; + squads: GQLSource[] | null; } export interface GQLOpportunityPreviewConnection { @@ -463,7 +463,7 @@ export const typeDefs = /* GraphQL */ ` type OpportunityPreviewResult { tags: [String!]! companies: [OpportunityPreviewCompany!]! - squads: [String!]! + squads: [Source!]! totalCount: Int } From 1dc0d4f2a0e040a995ba152e8a0697aa9d0fce1a Mon Sep 17 00:00:00 2001 From: Chris Bongers Date: Tue, 9 Dec 2025 14:52:57 +0200 Subject: [PATCH 2/3] fix: add type return whole object --- src/schema/opportunity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schema/opportunity.ts b/src/schema/opportunity.ts index 9cb10898e8..ba4653bc3a 100644 --- a/src/schema/opportunity.ts +++ b/src/schema/opportunity.ts @@ -1284,7 +1284,7 @@ export const resolvers: IResolvers = traceResolvers< const squads = uniqueifyArray( connection.edges.flatMap(({ node }) => - (node.activeSquads || []).map((squad) => squad.id), + (node.activeSquads || []).map((squad) => squad), ), ); From 3e9a9988dcee7dd15dca8c33fdcb611f0df4521e Mon Sep 17 00:00:00 2001 From: Chris Bongers Date: Tue, 9 Dec 2025 15:07:49 +0200 Subject: [PATCH 3/3] fix: ensure no dups --- src/common/utils.ts | 4 ++-- src/schema/opportunity.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/utils.ts b/src/common/utils.ts index cf06da9b3b..15d872c761 100644 --- a/src/common/utils.ts +++ b/src/common/utils.ts @@ -100,7 +100,7 @@ export const uniqueifyArray = (array: T[]): T[] => { return [...new Set(array)]; }; -export /** +/** * Remove duplicate values from an array of objects per unique key * * @template T @@ -110,7 +110,7 @@ export /** * @param {(item: T, index: number, uniqueKey: string) => R} [processItem] Optional function to process the item before adding it to the result array * @return {*} {R[]} */ -const uniqueifyObjectArray = ( +export const uniqueifyObjectArray = ( array: T[], uniqueKey: (item: T) => string, processItem?: (item: T, index: number, uniqueKey: string) => R, diff --git a/src/schema/opportunity.ts b/src/schema/opportunity.ts index ba4653bc3a..3813c7ffc6 100644 --- a/src/schema/opportunity.ts +++ b/src/schema/opportunity.ts @@ -17,6 +17,7 @@ import { getBufferFromStream, toGQLEnum, uniqueifyArray, + uniqueifyObjectArray, updateFlagsStatement, } from '../common'; import { @@ -1282,10 +1283,11 @@ export const resolvers: IResolvers = traceResolvers< const companies = getShowcaseCompanies(); - const squads = uniqueifyArray( + const squads = uniqueifyObjectArray( connection.edges.flatMap(({ node }) => (node.activeSquads || []).map((squad) => squad), ), + (squad) => squad.handle, ); return {