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
188 lines
5.8 KiB
TypeScript
188 lines
5.8 KiB
TypeScript
import { gql } from "graphql-tag"
|
|
|
|
import { CardBlock } from "../Fragments/Blocks/Card.graphql"
|
|
import { AccountPageLink } from "../Fragments/PageLink/AccountPageLink.graphql"
|
|
import { CampaignOverviewPageLink } from "../Fragments/PageLink/CampaignOverviewPageLink.graphql"
|
|
import { CampaignPageLink } from "../Fragments/PageLink/CampaignPageLink.graphql"
|
|
import { CollectionPageLink } from "../Fragments/PageLink/CollectionPageLink.graphql"
|
|
import { ContentPageLink } from "../Fragments/PageLink/ContentPageLink.graphql"
|
|
import { DestinationCityPageLink } from "../Fragments/PageLink/DestinationCityPageLink.graphql"
|
|
import { DestinationCountryPageLink } from "../Fragments/PageLink/DestinationCountryPageLink.graphql"
|
|
import { DestinationOverviewPageLink } from "../Fragments/PageLink/DestinationOverviewPageLink.graphql"
|
|
import { HotelPageLink } from "../Fragments/PageLink/HotelPageLink.graphql"
|
|
import { LoyaltyPageLink } from "../Fragments/PageLink/LoyaltyPageLink.graphql"
|
|
import { PromoCampaignPageLink } from "../Fragments/PageLink/PromoCampaignPageLink.graphql"
|
|
import { StartPageLink } from "../Fragments/PageLink/StartPageLink.graphql"
|
|
|
|
export const GetHeader = gql`
|
|
query GetHeader($locale: String!) {
|
|
all_header(limit: 1, locale: $locale) {
|
|
items {
|
|
top_link {
|
|
logged_in {
|
|
icon
|
|
is_contentstack_link
|
|
title
|
|
linkConnection {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...AccountPageLink
|
|
...CampaignOverviewPageLink
|
|
...CampaignPageLink
|
|
...CollectionPageLink
|
|
...ContentPageLink
|
|
...DestinationCityPageLink
|
|
...DestinationCountryPageLink
|
|
...DestinationOverviewPageLink
|
|
...HotelPageLink
|
|
...LoyaltyPageLink
|
|
...StartPageLink
|
|
...PromoCampaignPageLink
|
|
}
|
|
}
|
|
}
|
|
external_link {
|
|
href
|
|
title
|
|
}
|
|
}
|
|
logged_out {
|
|
icon
|
|
is_contentstack_link
|
|
title
|
|
linkConnection {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...AccountPageLink
|
|
...CampaignOverviewPageLink
|
|
...CampaignPageLink
|
|
...CollectionPageLink
|
|
...ContentPageLink
|
|
...DestinationCityPageLink
|
|
...DestinationCountryPageLink
|
|
...DestinationOverviewPageLink
|
|
...HotelPageLink
|
|
...LoyaltyPageLink
|
|
...StartPageLink
|
|
...PromoCampaignPageLink
|
|
}
|
|
}
|
|
}
|
|
external_link {
|
|
href
|
|
title
|
|
}
|
|
}
|
|
}
|
|
menu_items {
|
|
is_contentstack_link
|
|
title
|
|
linkConnection {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...AccountPageLink
|
|
...CampaignOverviewPageLink
|
|
...CampaignPageLink
|
|
...CollectionPageLink
|
|
...ContentPageLink
|
|
...DestinationCityPageLink
|
|
...DestinationCountryPageLink
|
|
...DestinationOverviewPageLink
|
|
...HotelPageLink
|
|
...LoyaltyPageLink
|
|
...StartPageLink
|
|
...PromoCampaignPageLink
|
|
}
|
|
}
|
|
}
|
|
external_link {
|
|
href
|
|
title
|
|
}
|
|
see_all_link {
|
|
is_contentstack_link
|
|
title
|
|
linkConnection {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...AccountPageLink
|
|
...CampaignOverviewPageLink
|
|
...CampaignPageLink
|
|
...CollectionPageLink
|
|
...ContentPageLink
|
|
...DestinationCityPageLink
|
|
...DestinationCountryPageLink
|
|
...DestinationOverviewPageLink
|
|
...HotelPageLink
|
|
...LoyaltyPageLink
|
|
...StartPageLink
|
|
...PromoCampaignPageLink
|
|
}
|
|
}
|
|
}
|
|
external_link {
|
|
href
|
|
title
|
|
}
|
|
}
|
|
submenu {
|
|
title
|
|
links {
|
|
is_contentstack_link
|
|
title
|
|
linkConnection {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...AccountPageLink
|
|
...CampaignOverviewPageLink
|
|
...CampaignPageLink
|
|
...CollectionPageLink
|
|
...ContentPageLink
|
|
...DestinationCityPageLink
|
|
...DestinationCountryPageLink
|
|
...DestinationOverviewPageLink
|
|
...HotelPageLink
|
|
...LoyaltyPageLink
|
|
...StartPageLink
|
|
...PromoCampaignPageLink
|
|
}
|
|
}
|
|
}
|
|
external_link {
|
|
href
|
|
title
|
|
}
|
|
}
|
|
}
|
|
cardConnection {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...CardBlock
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${CardBlock}
|
|
${AccountPageLink}
|
|
${CampaignOverviewPageLink}
|
|
${CampaignPageLink}
|
|
${CollectionPageLink}
|
|
${ContentPageLink}
|
|
${DestinationCityPageLink}
|
|
${DestinationCountryPageLink}
|
|
${DestinationOverviewPageLink}
|
|
${HotelPageLink}
|
|
${LoyaltyPageLink}
|
|
${StartPageLink}
|
|
${PromoCampaignPageLink}
|
|
`
|