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
151 lines
3.8 KiB
TypeScript
151 lines
3.8 KiB
TypeScript
import { gql } from "graphql-tag"
|
|
|
|
import { AccountPageLink } from "../PageLink/AccountPageLink.graphql"
|
|
import { CampaignOverviewPageLink } from "../PageLink/CampaignOverviewPageLink.graphql"
|
|
import { CampaignPageLink } from "../PageLink/CampaignPageLink.graphql"
|
|
import { CollectionPageLink } from "../PageLink/CollectionPageLink.graphql"
|
|
import { ContentPageLink } from "../PageLink/ContentPageLink.graphql"
|
|
import { DestinationCityPageLink } from "../PageLink/DestinationCityPageLink.graphql"
|
|
import { DestinationCountryPageLink } from "../PageLink/DestinationCountryPageLink.graphql"
|
|
import { DestinationOverviewPageLink } from "../PageLink/DestinationOverviewPageLink.graphql"
|
|
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 { CardBlock } from "./Card.graphql"
|
|
import { InfoCardBlock } from "./InfoCard.graphql"
|
|
import { LoyaltyCardBlock } from "./LoyaltyCard.graphql"
|
|
import { TeaserCardBlock } from "./TeaserCard.graphql"
|
|
|
|
export const CardsGrid_ContentPage = gql`
|
|
fragment CardsGrid_ContentPage on ContentPageBlocksCardsGrid {
|
|
cards_grid {
|
|
layout
|
|
preamble
|
|
theme
|
|
title
|
|
cardConnection(limit: 10) {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...CardBlock
|
|
...LoyaltyCardBlock
|
|
...TeaserCardBlock
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${CardBlock}
|
|
${LoyaltyCardBlock}
|
|
${TeaserCardBlock}
|
|
`
|
|
|
|
export const CardsGrid_CollectionPage = gql`
|
|
fragment CardsGrid_CollectionPage on CollectionPageBlocksCardsGrid {
|
|
cards_grid {
|
|
layout
|
|
preamble
|
|
theme
|
|
title
|
|
cardConnection(limit: 10) {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...CardBlock
|
|
...TeaserCardBlock
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${CardBlock}
|
|
${TeaserCardBlock}
|
|
`
|
|
|
|
export const CardsGrid_LoyaltyPage = gql`
|
|
fragment CardsGrid_LoyaltyPage on LoyaltyPageBlocksCardsGrid {
|
|
cards_grid {
|
|
layout
|
|
preamble
|
|
theme
|
|
title
|
|
cardConnection(limit: 10) {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...CardBlock
|
|
...LoyaltyCardBlock
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${CardBlock}
|
|
${LoyaltyCardBlock}
|
|
`
|
|
|
|
export const CardsGrid_StartPage = gql`
|
|
fragment CardsGrid_StartPage on StartPageBlocksCardsGrid {
|
|
cards_grid {
|
|
layout
|
|
preamble
|
|
theme
|
|
title
|
|
cardConnection(limit: 10) {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...CardBlock
|
|
...TeaserCardBlock
|
|
...InfoCardBlock
|
|
}
|
|
}
|
|
}
|
|
link {
|
|
cta_text
|
|
is_contentstack_link
|
|
open_in_new_tab
|
|
external_link {
|
|
href
|
|
title
|
|
}
|
|
linkConnection {
|
|
edges {
|
|
node {
|
|
__typename
|
|
...AccountPageLink
|
|
...CampaignOverviewPageLink
|
|
...CampaignPageLink
|
|
...CollectionPageLink
|
|
...ContentPageLink
|
|
...DestinationCityPageLink
|
|
...DestinationCountryPageLink
|
|
...DestinationOverviewPageLink
|
|
...HotelPageLink
|
|
...LoyaltyPageLink
|
|
...StartPageLink
|
|
...PromoCampaignPageLink
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
${CardBlock}
|
|
${InfoCardBlock}
|
|
${TeaserCardBlock}
|
|
${AccountPageLink}
|
|
${CampaignOverviewPageLink}
|
|
${CampaignPageLink}
|
|
${CollectionPageLink}
|
|
${ContentPageLink}
|
|
${DestinationCityPageLink}
|
|
${DestinationCountryPageLink}
|
|
${DestinationOverviewPageLink}
|
|
${HotelPageLink}
|
|
${LoyaltyPageLink}
|
|
${StartPageLink}
|
|
${PromoCampaignPageLink}
|
|
`
|