diff --git a/lib/graphql/Fragments/Refs/Breadcrumbs.graphql b/lib/graphql/Fragments/Refs/Breadcrumbs.graphql deleted file mode 100644 index 0c8837664..000000000 --- a/lib/graphql/Fragments/Refs/Breadcrumbs.graphql +++ /dev/null @@ -1,51 +0,0 @@ -#import "./System.graphql" - -fragment MyPagesBreadcrumbsRefs on AccountPage { - web { - breadcrumbs { - title - parentsConnection { - edges { - node { - ... on AccountPage { - breadcrumbs { - title - } - system { - ...System - } - } - } - } - } - } - } - system { - ...System - } -} - -fragment LoyaltyPageBreadcrumbsRefs on LoyaltyPage { - web { - breadcrumbs { - title - parentsConnection { - edges { - node { - ... on AccountPage { - breadcrumbs { - title - } - system { - ...System - } - } - } - } - } - } - } - system { - ...System - } -} diff --git a/lib/graphql/Fragments/Refs/LoyaltyPage/Breadcrumbs.graphql b/lib/graphql/Fragments/Refs/LoyaltyPage/Breadcrumbs.graphql new file mode 100644 index 000000000..eeb80896c --- /dev/null +++ b/lib/graphql/Fragments/Refs/LoyaltyPage/Breadcrumbs.graphql @@ -0,0 +1,26 @@ +#import "../System.graphql" + +fragment LoyaltyPageBreadcrumbsRefs on LoyaltyPage { + web { + breadcrumbs { + title + parentsConnection { + edges { + node { + ... on AccountPage { + breadcrumbs { + title + } + system { + ...System + } + } + } + } + } + } + } + system { + ...System + } +} diff --git a/lib/graphql/Fragments/Refs/LoyaltyPage.graphql b/lib/graphql/Fragments/Refs/LoyaltyPage/LoyaltyPage.graphql similarity index 72% rename from lib/graphql/Fragments/Refs/LoyaltyPage.graphql rename to lib/graphql/Fragments/Refs/LoyaltyPage/LoyaltyPage.graphql index ebe48f8fb..70cba0639 100644 --- a/lib/graphql/Fragments/Refs/LoyaltyPage.graphql +++ b/lib/graphql/Fragments/Refs/LoyaltyPage/LoyaltyPage.graphql @@ -1,4 +1,4 @@ -#import "./System.graphql" +#import "../System.graphql" fragment LoyaltyPageRef on LoyaltyPage { system { diff --git a/lib/graphql/Fragments/Refs/AccountPage.graphql b/lib/graphql/Fragments/Refs/MyPages/AccountPage.graphql similarity index 72% rename from lib/graphql/Fragments/Refs/AccountPage.graphql rename to lib/graphql/Fragments/Refs/MyPages/AccountPage.graphql index 2b27c3f3f..043af22f9 100644 --- a/lib/graphql/Fragments/Refs/AccountPage.graphql +++ b/lib/graphql/Fragments/Refs/MyPages/AccountPage.graphql @@ -1,4 +1,4 @@ -#import "./System.graphql" +#import "../System.graphql" fragment AccountPageRef on AccountPage { system { diff --git a/lib/graphql/Fragments/Refs/MyPages/Breadcrumbs.graphql b/lib/graphql/Fragments/Refs/MyPages/Breadcrumbs.graphql new file mode 100644 index 000000000..37e2c17ca --- /dev/null +++ b/lib/graphql/Fragments/Refs/MyPages/Breadcrumbs.graphql @@ -0,0 +1,26 @@ +#import "../System.graphql" + +fragment MyPagesBreadcrumbsRefs on AccountPage { + web { + breadcrumbs { + title + parentsConnection { + edges { + node { + ... on AccountPage { + breadcrumbs { + title + } + system { + ...System + } + } + } + } + } + } + } + system { + ...System + } +} diff --git a/lib/graphql/Query/AccountPage.graphql b/lib/graphql/Query/AccountPage.graphql index bd7aacef6..63dd933b9 100644 --- a/lib/graphql/Query/AccountPage.graphql +++ b/lib/graphql/Query/AccountPage.graphql @@ -2,9 +2,9 @@ #import "../Fragments/MyPages/AccountPage/AccountPageContentShortcuts.graphql" #import "../Fragments/MyPages/AccountPage/AccountPageContentTextContent.graphql" -#import "../Fragments/Refs/AccountPage.graphql" +#import "../Fragments/Refs/MyPages/AccountPage.graphql" #import "../Fragments/Refs/ContentPage.graphql" -#import "../Fragments/Refs/LoyaltyPage.graphql" +#import "../Fragments/Refs/LoyaltyPage/LoyaltyPage.graphql" #import "../Fragments/Refs/System.graphql" query GetAccountPage($locale: String!, $uid: String!) { diff --git a/lib/graphql/Query/BreadcrumbsLoyaltyPage.graphql b/lib/graphql/Query/BreadcrumbsLoyaltyPage.graphql index 42db40cbb..bf8265b4e 100644 --- a/lib/graphql/Query/BreadcrumbsLoyaltyPage.graphql +++ b/lib/graphql/Query/BreadcrumbsLoyaltyPage.graphql @@ -1,5 +1,5 @@ #import "../Fragments/LoyaltyPage/Breadcrumbs.graphql" -#import "../Fragments/Refs/Breadcrumbs.graphql" +#import "../Fragments/Refs/LoyaltyPage/Breadcrumbs.graphql" query GetLoyaltyPageBreadcrumbs($locale: String!, $url: String!) { all_page: all_loyalty_page(locale: $locale, where: { url: $url }) { diff --git a/lib/graphql/Query/BreadcrumbsAccountPage.graphql b/lib/graphql/Query/BreadcrumbsMyPages.graphql similarity index 89% rename from lib/graphql/Query/BreadcrumbsAccountPage.graphql rename to lib/graphql/Query/BreadcrumbsMyPages.graphql index 36204f370..a94b5dece 100644 --- a/lib/graphql/Query/BreadcrumbsAccountPage.graphql +++ b/lib/graphql/Query/BreadcrumbsMyPages.graphql @@ -1,5 +1,5 @@ #import "../Fragments/MyPages/Breadcrumbs.graphql" -#import "../Fragments/Refs/Breadcrumbs.graphql" +#import "../Fragments/Refs/MyPages/Breadcrumbs.graphql" query GetMyPagesBreadcrumbs($locale: String!, $url: String!) { all_page: all_account_page(locale: $locale, where: { url: $url }) { diff --git a/lib/graphql/Query/LoyaltyPage.graphql b/lib/graphql/Query/LoyaltyPage.graphql index 9b35ed081..aeed3368f 100644 --- a/lib/graphql/Query/LoyaltyPage.graphql +++ b/lib/graphql/Query/LoyaltyPage.graphql @@ -6,9 +6,9 @@ #import "../Fragments/PageLink/ContentPageLink.graphql" #import "../Fragments/PageLink/LoyaltyPageLink.graphql" -#import "../Fragments/Refs/AccountPage.graphql" +#import "../Fragments/Refs/MyPages/AccountPage.graphql" #import "../Fragments/Refs/ContentPage.graphql" -#import "../Fragments/Refs/LoyaltyPage.graphql" +#import "../Fragments/Refs/LoyaltyPage/LoyaltyPage.graphql" #import "../Fragments/Refs/System.graphql" query GetLoyaltyPage($locale: String!, $uid: String!) { diff --git a/lib/graphql/Query/NavigationMyPages.graphql b/lib/graphql/Query/NavigationMyPages.graphql index 42f8b1675..2151dd7ac 100644 --- a/lib/graphql/Query/NavigationMyPages.graphql +++ b/lib/graphql/Query/NavigationMyPages.graphql @@ -1,9 +1,9 @@ #import "../Fragments/PageLink/AccountPageLink.graphql" #import "../Fragments/PageLink/ContentPageLink.graphql" #import "../Fragments/PageLink/LoyaltyPageLink.graphql" -#import "../Fragments/Refs/AccountPage.graphql" +#import "../Fragments/Refs/MyPages/AccountPage.graphql" #import "../Fragments/Refs/ContentPage.graphql" -#import "../Fragments/Refs/LoyaltyPage.graphql" +#import "../Fragments/Refs/LoyaltyPage/LoyaltyPage.graphql" #import "../Fragments/Refs/System.graphql" query GetNavigationMyPages($locale: String!) { diff --git a/server/routers/contentstack/breadcrumbs/query.ts b/server/routers/contentstack/breadcrumbs/query.ts index 02b34bba0..f22b42fa5 100644 --- a/server/routers/contentstack/breadcrumbs/query.ts +++ b/server/routers/contentstack/breadcrumbs/query.ts @@ -1,11 +1,11 @@ -import { - GetMyPagesBreadcrumbs, - GetMyPagesBreadcrumbsRefs, -} from "@/lib/graphql/Query/BreadcrumbsAccountPage.graphql" import { GetLoyaltyPageBreadcrumbs, GetLoyaltyPageBreadcrumbsRefs, } from "@/lib/graphql/Query/BreadcrumbsLoyaltyPage.graphql" +import { + GetMyPagesBreadcrumbs, + GetMyPagesBreadcrumbsRefs, +} from "@/lib/graphql/Query/BreadcrumbsMyPages.graphql" import { request } from "@/lib/graphql/request" import { internalServerError, notFound } from "@/server/errors/trpc" import { contentstackProcedure, router } from "@/server/trpc"