From 9d52838569ed8f1a3f1487d2fe7dafc4b2440ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matilda=20Landstr=C3=B6m?= Date: Tue, 28 May 2024 15:45:30 +0200 Subject: [PATCH] refactor: move LoyaltyPageBreadcrumbs fragment to separate file --- .../Fragments/LoyaltyPage/Breadcrumbs.graphql | 23 ++++++++++++++++++ .../Fragments/MyPages/Breadcrumbs.graphql | 24 ------------------- .../Query/BreadcrumbsLoyaltyPage.graphql | 2 +- lib/graphql/Query/LoyaltyPage.graphql | 2 +- 4 files changed, 25 insertions(+), 26 deletions(-) create mode 100644 lib/graphql/Fragments/LoyaltyPage/Breadcrumbs.graphql diff --git a/lib/graphql/Fragments/LoyaltyPage/Breadcrumbs.graphql b/lib/graphql/Fragments/LoyaltyPage/Breadcrumbs.graphql new file mode 100644 index 000000000..d0a49cf73 --- /dev/null +++ b/lib/graphql/Fragments/LoyaltyPage/Breadcrumbs.graphql @@ -0,0 +1,23 @@ +fragment LoyaltyPageBreadcrumbs on LoyaltyPage { + web { + breadcrumbs { + title + parentsConnection { + edges { + node { + ... on AccountPage { + breadcrumbs { + title + } + system { + locale + uid + } + url + } + } + } + } + } + } +} diff --git a/lib/graphql/Fragments/MyPages/Breadcrumbs.graphql b/lib/graphql/Fragments/MyPages/Breadcrumbs.graphql index ed57b6bb2..4540fdb8d 100644 --- a/lib/graphql/Fragments/MyPages/Breadcrumbs.graphql +++ b/lib/graphql/Fragments/MyPages/Breadcrumbs.graphql @@ -21,27 +21,3 @@ fragment AccountPageBreadcrumbs on AccountPage { } } } - -fragment LoyaltyPageBreadcrumbs on LoyaltyPage { - web { - breadcrumbs { - title - parentsConnection { - edges { - node { - ... on AccountPage { - breadcrumbs { - title - } - system { - locale - uid - } - url - } - } - } - } - } - } -} diff --git a/lib/graphql/Query/BreadcrumbsLoyaltyPage.graphql b/lib/graphql/Query/BreadcrumbsLoyaltyPage.graphql index 9af463f0a..42db40cbb 100644 --- a/lib/graphql/Query/BreadcrumbsLoyaltyPage.graphql +++ b/lib/graphql/Query/BreadcrumbsLoyaltyPage.graphql @@ -1,4 +1,4 @@ -#import "../Fragments/MyPages/Breadcrumbs.graphql" +#import "../Fragments/LoyaltyPage/Breadcrumbs.graphql" #import "../Fragments/Refs/Breadcrumbs.graphql" query GetLoyaltyPageBreadcrumbs($locale: String!, $url: String!) { diff --git a/lib/graphql/Query/LoyaltyPage.graphql b/lib/graphql/Query/LoyaltyPage.graphql index 2f7380436..9b35ed081 100644 --- a/lib/graphql/Query/LoyaltyPage.graphql +++ b/lib/graphql/Query/LoyaltyPage.graphql @@ -1,6 +1,7 @@ #import "../Fragments/Image.graphql" #import "../Fragments/Blocks/Card.graphql" #import "../Fragments/Blocks/Refs/Card.graphql" +#import "../Fragments/LoyaltyPage/Breadcrumbs.graphql" #import "../Fragments/PageLink/AccountPageLink.graphql" #import "../Fragments/PageLink/ContentPageLink.graphql" #import "../Fragments/PageLink/LoyaltyPageLink.graphql" @@ -9,7 +10,6 @@ #import "../Fragments/Refs/ContentPage.graphql" #import "../Fragments/Refs/LoyaltyPage.graphql" #import "../Fragments/Refs/System.graphql" -#import "../Fragments/MyPages/Breadcrumbs.graphql" query GetLoyaltyPage($locale: String!, $uid: String!) { loyalty_page(uid: $uid, locale: $locale) {