From 5d0ff12b399d578abe7e12aadb4836328740188f Mon Sep 17 00:00:00 2001 From: Gunnar Velle Date: Wed, 23 Oct 2024 08:56:02 +0200 Subject: [PATCH 1/2] Use contextid as id for programme --- src/resolvers/programmeResolvers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolvers/programmeResolvers.ts b/src/resolvers/programmeResolvers.ts index 94d233cb..53056258 100644 --- a/src/resolvers/programmeResolvers.ts +++ b/src/resolvers/programmeResolvers.ts @@ -20,7 +20,7 @@ import { nodeToTaxonomyEntity } from "../utils/apiHelpers"; const nodeToProgramme = (node: Node, language: string): GQLProgrammePage => { return { - id: node.id, + id: node.contextId ?? node.id, title: { title: node.name, language: language, From 9601cb99a42ecf54e45ef65ddeb567023b32d44d Mon Sep 17 00:00:00 2001 From: Gunnar Velle Date: Wed, 23 Oct 2024 09:37:20 +0200 Subject: [PATCH 2/2] Add contextId --- src/resolvers/programmeResolvers.ts | 3 ++- src/schema.ts | 1 + src/types/schema.d.ts | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/resolvers/programmeResolvers.ts b/src/resolvers/programmeResolvers.ts index 53056258..eadd9a24 100644 --- a/src/resolvers/programmeResolvers.ts +++ b/src/resolvers/programmeResolvers.ts @@ -20,7 +20,8 @@ import { nodeToTaxonomyEntity } from "../utils/apiHelpers"; const nodeToProgramme = (node: Node, language: string): GQLProgrammePage => { return { - id: node.contextId ?? node.id, + id: node.id, + contextId: node.contextId, title: { title: node.name, language: language, diff --git a/src/schema.ts b/src/schema.ts index 44c3aeae..620d674b 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -783,6 +783,7 @@ export const typeDefs = gql` type ProgrammePage { id: String! + contextId: String title: Title! url: String contentUri: String diff --git a/src/types/schema.d.ts b/src/types/schema.d.ts index 80c6fa17..1ca6aec5 100644 --- a/src/types/schema.d.ts +++ b/src/types/schema.d.ts @@ -1532,6 +1532,7 @@ export type GQLPodcastSeriesWithEpisodes = GQLPodcastSeriesBase & { export type GQLProgrammePage = { __typename?: 'ProgrammePage'; contentUri?: Maybe; + contextId?: Maybe; desktopImage?: Maybe; grades?: Maybe>; id: Scalars['String']; @@ -4024,6 +4025,7 @@ export type GQLPodcastSeriesWithEpisodesResolvers = { contentUri?: Resolver, ParentType, ContextType>; + contextId?: Resolver, ParentType, ContextType>; desktopImage?: Resolver, ParentType, ContextType>; grades?: Resolver>, ParentType, ContextType>; id?: Resolver;