Merged in feat/rework-contentstack (pull request #3493)

Feat(SW-3708): refactor contentstack fetching (removing all refs) and cache invalidation

* Remove all REFS

* Revalidate correct language

* PR fixes

* PR fixes

* Throw when errors from contentstack api


Approved-by: Joakim Jäderberg
This commit is contained in:
Linus Flood
2026-01-27 12:38:36 +00:00
parent a5e214f783
commit 5fc93472f4
193 changed files with 489 additions and 9018 deletions

View File

@@ -1,16 +1,6 @@
import { gql } from "graphql-tag"
import { AccountPageRef } from "../AccountPage/Ref.graphql"
import { CampaignOverviewPageRef } from "../CampaignOverviewPage/Ref.graphql"
import { CampaignPageRef } from "../CampaignPage/Ref.graphql"
import { CollectionPageRef } from "../CollectionPage/Ref.graphql"
import { ContentPageRef } from "../ContentPage/Ref.graphql"
import { DestinationCityPageRef } from "../DestinationCityPage/Ref.graphql"
import { DestinationCountryPageRef } from "../DestinationCountryPage/Ref.graphql"
import { DestinationOverviewPageRef } from "../DestinationOverviewPage/Ref.graphql"
import { HotelPageRef } from "../HotelPage/Ref.graphql"
import { ImageContainer, ImageContainerRef } from "../ImageContainer.graphql"
import { LoyaltyPageRef } from "../LoyaltyPage/Ref.graphql"
import { ImageContainer } from "../ImageContainer.graphql"
import { AccountPageLink } from "../PageLink/AccountPageLink.graphql"
import { CampaignOverviewPageLink } from "../PageLink/CampaignOverviewPageLink.graphql"
import { CampaignPageLink } from "../PageLink/CampaignPageLink.graphql"
@@ -23,9 +13,7 @@ import { HotelPageLink } from "../PageLink/HotelPageLink.graphql"
import { LoyaltyPageLink } from "../PageLink/LoyaltyPageLink.graphql"
import { PromoCampaignPageLink } from "../PageLink/PromoCampaignPageLink.graphql"
import { StartPageLink } from "../PageLink/StartPageLink.graphql"
import { PromoCampaignPageRef } from "../PromoCampaignPage/Ref.graphql"
import { StartPageRef } from "../StartPage/Ref.graphql"
import { SysAsset, SysAssetRef } from "../SysAsset.graphql"
import { SysAsset } from "../SysAsset.graphql"
export const ContentSidebar_ContentPage = gql`
fragment ContentSidebar_ContentPage on ContentPageSidebarContent {
@@ -72,50 +60,6 @@ export const ContentSidebar_ContentPage = gql`
${PromoCampaignPageLink}
`
export const ContentSidebar_ContentPageRefs = gql`
fragment ContentSidebar_ContentPageRefs on ContentPageSidebarContent {
content {
content {
embedded_itemsConnection {
edges {
node {
__typename
...SysAssetRef
...ImageContainerRef
...AccountPageRef
...CampaignOverviewPageRef
...CampaignPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
...PromoCampaignPageRef
}
}
}
}
}
}
${SysAssetRef}
${ImageContainerRef}
${AccountPageRef}
${CampaignOverviewPageRef}
${CampaignPageRef}
${CollectionPageRef}
${ContentPageRef}
${DestinationCityPageRef}
${DestinationCountryPageRef}
${DestinationOverviewPageRef}
${HotelPageRef}
${LoyaltyPageRef}
${StartPageRef}
${PromoCampaignPageRef}
`
export const ContentSidebar_LoyaltyPage = gql`
fragment ContentSidebar_LoyaltyPage on LoyaltyPageSidebarContent {
content {
@@ -160,47 +104,3 @@ export const ContentSidebar_LoyaltyPage = gql`
${StartPageLink}
${PromoCampaignPageLink}
`
export const ContentSidebar_LoyaltyPageRefs = gql`
fragment ContentSidebar_LoyaltyPageRefs on LoyaltyPageSidebarContent {
content {
content {
embedded_itemsConnection {
edges {
node {
__typename
...SysAssetRef
...ImageContainerRef
...AccountPageRef
...CampaignOverviewPageRef
...CampaignPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
...PromoCampaignPageRef
}
}
}
}
}
}
${SysAssetRef}
${ImageContainerRef}
${AccountPageRef}
${CampaignOverviewPageRef}
${CampaignPageRef}
${CollectionPageRef}
${ContentPageRef}
${DestinationCityPageRef}
${DestinationCountryPageRef}
${DestinationOverviewPageRef}
${HotelPageRef}
${LoyaltyPageRef}
${StartPageRef}
${PromoCampaignPageRef}
`

View File

@@ -1,15 +1,5 @@
import { gql } from "graphql-tag"
import { AccountPageRef } from "../AccountPage/Ref.graphql"
import { CampaignOverviewPageRef } from "../CampaignOverviewPage/Ref.graphql"
import { CampaignPageRef } from "../CampaignPage/Ref.graphql"
import { CollectionPageRef } from "../CollectionPage/Ref.graphql"
import { ContentPageRef } from "../ContentPage/Ref.graphql"
import { DestinationCityPageRef } from "../DestinationCityPage/Ref.graphql"
import { DestinationCountryPageRef } from "../DestinationCountryPage/Ref.graphql"
import { DestinationOverviewPageRef } from "../DestinationOverviewPage/Ref.graphql"
import { HotelPageRef } from "../HotelPage/Ref.graphql"
import { LoyaltyPageRef } from "../LoyaltyPage/Ref.graphql"
import { AccountPageLink } from "../PageLink/AccountPageLink.graphql"
import { CampaignOverviewPageLink } from "../PageLink/CampaignOverviewPageLink.graphql"
import { CampaignPageLink } from "../PageLink/CampaignPageLink.graphql"
@@ -22,8 +12,6 @@ import { HotelPageLink } from "../PageLink/HotelPageLink.graphql"
import { LoyaltyPageLink } from "../PageLink/LoyaltyPageLink.graphql"
import { PromoCampaignPageLink } from "../PageLink/PromoCampaignPageLink.graphql"
import { StartPageLink } from "../PageLink/StartPageLink.graphql"
import { PromoCampaignPageRef } from "../PromoCampaignPage/Ref.graphql"
import { StartPageRef } from "../StartPage/Ref.graphql"
const ContactFields = gql`
fragment ContactFields on ContactFields {
@@ -90,46 +78,6 @@ export const JoinLoyaltyContactSidebar_ContentPage = gql`
${PromoCampaignPageLink}
`
export const JoinLoyaltyContactSidebar_ContentPageRefs = gql`
fragment JoinLoyaltyContactSidebar_ContentPageRefs on ContentPageSidebarJoinLoyaltyContact {
join_loyalty_contact {
button {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...CampaignOverviewPageRef
...CampaignPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
...PromoCampaignPageRef
}
}
}
}
}
}
${AccountPageRef}
${CampaignOverviewPageRef}
${CampaignPageRef}
${CollectionPageRef}
${ContentPageRef}
${DestinationCityPageRef}
${DestinationCountryPageRef}
${DestinationOverviewPageRef}
${HotelPageRef}
${LoyaltyPageRef}
${StartPageRef}
${PromoCampaignPageRef}
`
export const JoinLoyaltyContactSidebar_LoyaltyPage = gql`
fragment JoinLoyaltyContactSidebar_LoyaltyPage on LoyaltyPageSidebarJoinLoyaltyContact {
join_loyalty_contact {
@@ -186,43 +134,3 @@ export const JoinLoyaltyContactSidebar_LoyaltyPage = gql`
${StartPageLink}
${PromoCampaignPageLink}
`
export const JoinLoyaltyContactSidebar_LoyaltyPageRefs = gql`
fragment JoinLoyaltyContactSidebar_LoyaltyPageRefs on LoyaltyPageSidebarJoinLoyaltyContact {
join_loyalty_contact {
button {
linkConnection {
edges {
node {
__typename
...AccountPageRef
...CampaignOverviewPageRef
...CampaignPageRef
...CollectionPageRef
...ContentPageRef
...DestinationCityPageRef
...DestinationCountryPageRef
...DestinationOverviewPageRef
...HotelPageRef
...LoyaltyPageRef
...StartPageRef
...PromoCampaignPageRef
}
}
}
}
}
}
${AccountPageRef}
${CampaignOverviewPageRef}
${CampaignPageRef}
${CollectionPageRef}
${ContentPageRef}
${DestinationCityPageRef}
${DestinationCountryPageRef}
${DestinationOverviewPageRef}
${HotelPageRef}
${LoyaltyPageRef}
${StartPageRef}
${PromoCampaignPageRef}
`

View File

@@ -1,6 +1,6 @@
import { gql } from "graphql-tag"
import { Shortcuts, ShortcutsRefs } from "../Blocks/Shortcuts.graphql"
import { Shortcuts } from "../Blocks/Shortcuts.graphql"
export const QuickLinksSidebar_ContentPage = gql`
fragment QuickLinksSidebar_ContentPage on ContentPageSidebarShortcuts {
@@ -11,13 +11,3 @@ export const QuickLinksSidebar_ContentPage = gql`
}
${Shortcuts}
`
export const QuickLinksSidebar_ContentPageRefs = gql`
fragment QuickLinksSidebar_ContentPageRefs on ContentPageSidebarShortcuts {
shortcuts {
__typename
...ShortcutsRefs
}
}
${ShortcutsRefs}
`

View File

@@ -1,7 +1,6 @@
import { gql } from "graphql-tag"
import { CardBlock } from "../Blocks/Card.graphql"
import { CardBlockRef } from "../Blocks/Refs/Card.graphql"
export const ScriptedCardSidebar_ContentPage = gql`
fragment ScriptedCardSidebar_ContentPage on ContentPageSidebarScriptedCard {
@@ -20,19 +19,3 @@ export const ScriptedCardSidebar_ContentPage = gql`
}
${CardBlock}
`
export const ScriptedCardSidebar_ContentPageRefs = gql`
fragment ScriptedCardSidebar_ContentPageRefs on ContentPageSidebarScriptedCard {
scripted_card {
scripted_cardConnection {
edges {
node {
__typename
...CardBlockRef
}
}
}
}
}
${CardBlockRef}
`

View File

@@ -1,6 +1,5 @@
import { gql } from "graphql-tag"
import { TeaserCardBlockRef } from "../Blocks/Refs/TeaserCard.graphql"
import { TeaserCardBlock } from "../Blocks/TeaserCard.graphql"
export const TeaserCardSidebar_ContentPage = gql`
@@ -20,19 +19,3 @@ export const TeaserCardSidebar_ContentPage = gql`
}
${TeaserCardBlock}
`
export const TeaserCardSidebar_ContentPageRefs = gql`
fragment TeaserCardSidebar_ContentPageRefs on ContentPageSidebarTeaserCard {
teaser_card {
teaser_cardConnection {
edges {
node {
__typename
...TeaserCardBlockRef
}
}
}
}
}
${TeaserCardBlockRef}
`