From b2b7f4f85ad9d2017ba82f4175878cc32a922f29 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Fri, 16 Aug 2024 10:14:45 +0200 Subject: [PATCH] fix(SW-190): added cache for content page query and added breadcrumbs fetching for content page --- components/MyPages/Breadcrumbs/index.tsx | 1 + .../Refs/ContentPage/Breadcrumbs.graphql | 38 ++++++++++++ .../{ => ContentPage}/ContentPage.graphql | 2 +- lib/graphql/Query/AccountPage.graphql | 2 +- .../Query/BreadcrumbsContentPage.graphql | 21 +++++++ lib/graphql/Query/ContentPage.graphql | 3 - lib/graphql/Query/LoyaltyPage.graphql | 4 +- lib/graphql/Query/NavigationMyPages.graphql | 2 +- .../contentstack/breadcrumbs/output.ts | 18 +++++- .../routers/contentstack/breadcrumbs/query.ts | 58 +++++++++++++++++++ .../routers/contentstack/contentPage/query.ts | 16 +++-- 11 files changed, 151 insertions(+), 14 deletions(-) create mode 100644 lib/graphql/Fragments/Refs/ContentPage/Breadcrumbs.graphql rename lib/graphql/Fragments/Refs/{ => ContentPage}/ContentPage.graphql (72%) create mode 100644 lib/graphql/Query/BreadcrumbsContentPage.graphql diff --git a/components/MyPages/Breadcrumbs/index.tsx b/components/MyPages/Breadcrumbs/index.tsx index 3fccd6f25..752f77d5f 100644 --- a/components/MyPages/Breadcrumbs/index.tsx +++ b/components/MyPages/Breadcrumbs/index.tsx @@ -11,6 +11,7 @@ export default async function Breadcrumbs() { if (!breadcrumbs?.length) { return null } + const homeBreadcrumb = breadcrumbs.shift() return (